-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
install-poetry.py fails with "no module named 'virtualenv'" when run with Python from the Microsoft Store #4195
Comments
Root cause:
|
On Windows, when Python is installed from the Microsoft Store, pip is configured to always run with the --user option. In any other environment, where the user may have forced the user of --user, this will also break the installer. The --no-user option will override any default set in pip.ini. Fixes python-poetry#4195
FWIW, with my fix, the installed
It looks like
And indeed ... if you think it's worth it trying to get poetry working with the Microsoft Store python, and think my pull request is a sensible way to get past the first hurdle, I'm happy to open a separate issue to figure the next part out... |
I have more or less the same issue with Ubuntu 20.08, when I try to execute the following: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3.8 - I believe it's because of that part of the installation: with temporary_directory() as tmp_dir:
subprocess.call(
[sys.executable, "-m", "pip", "install", "virtualenv", "-t", tmp_dir],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
sys.path.insert(0, tmp_dir)
import virtualenv
virtualenv.cli_run([str(env_path), "--clear"])
return env_path The |
I have the same issue running with the latest script. # latest and fails https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
docker run -it python:3.7 bash -c "apt -yqq update && apt -y install --no-install-recommends curl && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | /usr/bin/python3 -"
# deprecated and works https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
docker run -it python:3.7 bash -c "apt -yqq update && apt -y install --no-install-recommends curl && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | /usr/bin/python3 -" |
Alternatively, if it is not a goal to support Python from the Microsoft Store, I think the installer should bug out early and loudly! |
Having the same problem on Ubuntu 18.04 WSL. At first it was because of $ mktemp -d
/tmp/tmp.YuayGzcNwi
$ python3 -m pip install virtualenv -t /tmp/tmp.YuayGzcNwi
[unrelated logs omitted]
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 360, in run
prefix=options.prefix_path,
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/usr/lib/python3/dist-packages/pip/locations.py", line 153, in distutils_scheme
i.finalize_options()
File "/usr/lib/python3.6/distutils/command/install.py", line 274, in finalize_options
raise DistutilsOptionError("can't combine user with prefix, "
distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base But if I use a newer version of $ mktemp -d
/tmp/tmp.4j1OAffTGx
$ python3.9 -m pip install virtualenv -t /tmp/tmp.4j1OAffTGx
[unrelated logs omitted]
Installing collected packages: six, platformdirs, filelock, distlib, backports.entry-points-selectable, virtualenv
Successfully installed backports.entry-points-selectable-1.1.0 distlib-0.3.2 filelock-3.0.12 platformdirs-2.2.0 six-1.16.0 virtualenv-20.7.0 $ python3 -m pip -V # system python with system pip
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
$ python3.9 -m pip -V
pip 21.2.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9) And with this version of $ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3.9 -
[unrelated logs omitted]
Poetry (1.1.7) is installed now. Great!
You can test that everything is set up by executing:
`poetry --version`
$ poetry --version
Poetry version 1.1.7 So there are three problems with
One possible solution to the first and second problems: provide a version of Edit: |
FYI Downside - you have to put |
The root cause of this issue was resolved by #4099. See the bottom part of #4463 (comment) for more information. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Windows 10 20H2 (10.0.19042.1052)
Poetry version: N/A
Link of a Gist with the contents of your pyproject.toml file: N/A
Issue
I'm trying the new installer with Pyton 3.9 from the Microsoft Store.
When
install-poetry.py
runspip
to install thevirtualenv
module, it doesn't check the return code. If I change the installer to usesubprocess.check_call
then I get:... but I've no idea where the output of
pip
is disappearing to.If I try to run
pip
manually, I get...No idea what's going on there. But I think the installer should have caught the error & displayed it to me.
The text was updated successfully, but these errors were encountered: