-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows embedable support #1774
Comments
Earlier version seems to work $ pip install "virtualenv<20"
Collecting virtualenv<20
Downloading virtualenv-16.7.10-py2.py3-none-any.whl (3.4 MB)
|████████████████████████████████| 3.4 MB 50 kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-16.7.10 However it seems not to be able to create a virtualenv. $ virtualenv.exe pyxxx
Using base prefix 'c:\\python382_32b'
Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 86, in _run_code
File "C:\python382_32b\Scripts\virtualenv.exe\__main__.py", line 7, in <module>
File "c:\python382_32b\lib\site-packages\virtualenv.py", line 859, in main
create_environment(
File "c:\python382_32b\lib\site-packages\virtualenv.py", line 1161, in create_environment
install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
File "c:\python382_32b\lib\site-packages\virtualenv.py", line 1467, in install_python
writefile(site_filename_dst, SITE_PY)
File "c:\python382_32b\lib\site-packages\virtualenv.py", line 431, in writefile
with open(dest, "wb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\pyxxx\\python38.zip\\site.py' |
I can't reproduce this. My versions of pip, setuptools and wheel are the same, this is in a fresh Python 3.8.0 venv. I am using Windows 10, but I'm not sure how that would make a difference here. Your prompt is |
This feels like a pip issue; as it's related to installing the package. For now, we still need a reproduced of this. Can you provide more detailed information? |
I just noticed:
It looks like you have the stdlib in a zip file. That's unusual - are you by any chance trying to use the embedded Python distribution? That's not intended for "general" use, and could be why you're getting issues here. Please describe how you installed your Python environment, as it may be relevant. |
Closing for now as we've got no response to our request for more information. If you can acquire those please post the details and we'll reopen the issue. |
It is indeed the embedded python version. My goal was to be try the new python version along my previous version, it appeared to me like the most obvious thing to do, however it seems not so obvious... |
How did you install an embedded Python? |
@gaborbernat I was specifically talking about the windows embeddable package, which is available as a zipfile that can be unzipped anywhere. The problem is that while it appears to work like "normal" Python, it's tuned specifically for embedding into your own application - so, for example, it doesn't include pip, and you need to do some config changes to get pip to work. It's not really a supported use of that distribution. For virtualenv, I guess there is a question of whether you want to support setups where the standard library is zipped up and/or contains only |
Working only with pyc files is already supported. Them being zipped up is an interesting question; which boils down to the fact can we even support these without unzipping the entire library. |
I unzipped the embedded package: https://www.python.org/ftp/python/3.8.2/python-3.8.2-embed-win32.zip |
Wow that feels complicated for a newcomer. Unless there's a more just install/extract and use way of this I'm tempted that to say that this is not supported. |
Up to you. I'm ok with your either your decision, as I somehow have my virtual environment using my above steps. (I can have as many copies of that as I want...) |
I ran into the same issue and was not able to get |
My use case is the same as above - wanting something portable on Windows without dealing with registry changes. Embedded python doesn't ship with venv so I was hoping to use this. I was able to run Interestingly, import cowsay
cowsay.cow('Hello World')
I was originally using "git bash" (which uses msys2) but I tried it in Powershell and got the the same thing. I also tried dropping a python311._pth into the venv folder with this but I'm not really sure what I'm doing there. .\Lib
.\python311
.\Scripts
.
# import site is consistent with non-embedded
# import site
#
import site I also saw pypa/pip#9767 |
Thye nuget packages described here might be more suitable for that use case. |
Thanks @pfmoore - introducing a dependency on nuget (which I've never used before, Windows is definitely of a secondary thing for me) when it's not in my regular stack isn't ideal for my particular situation. One reason I'm avoiding the registry is that after getting a bit too fancy with scripting the regular installer some registry stuff got a bit screwy and spent an hour or two just deleting registry entries. I ended up fixing it - .\Lib
.\python311
.\Scripts
.
C:\Users\ben\bin\python-portable\Lib
# import site is consistent with non-embedded
# import site
#
import site It seems like this could be an easy fix - that path I added (
|
Issue
Installing virtualenv with
pip install virtualenv
should install the package.I get error:
Environment
Provide at least:
Python version:
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Output of the virtual environment creation
Well output of installation process.
The text was updated successfully, but these errors were encountered: