Skip to content
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

Venv is created without pip #169

Closed
cauebs opened this issue May 31, 2018 · 9 comments
Closed

Venv is created without pip #169

cauebs opened this issue May 31, 2018 · 9 comments

Comments

@cauebs
Copy link
Contributor

cauebs commented May 31, 2018

This causes an EnvironmentError: Permission Denied when I try to install anything, because it ends up using system-wide pip. What I find terribly strange is that the necessary flag is actually being passed here: https://github.com/sdispater/poetry/blob/develop/poetry/utils/venv.py#L140

~ $ poetry new foo
Created package foo in foo
~ $ cd foo
~/foo $ poetry add -D mypy
Using version ^0.600.0 for mypy

Updating dependencies
Resolving dependencies... (0.1s)


Package operations: 8 installs, 0 updates, 0 removals

Writing lock file

  - Installing atomicwrites (1.1.5)
                                                                                                                                        
[VenvCommandError]                                                                                                       
Command ['pip', 'install', '--no-deps', '-r', '/tmp/atomicwrites-1.1.55axra81lreqs.txt'] errored with the following output:           
Collecting atomicwrites==1.1.5 (from -r /tmp/atomicwrites-1.1.55axra81lreqs.txt (line 1))                                             
  Using cached https://files.pythonhosted.org/packages/0a/e8/cd6375e7a59664eeea9e1c77a766eeac0fc3083bb958c2b41ec46b95f29c/atomicwrit  
es-1.1.5-py2.py3-none-any.whl                                                                                                         
Installing collected packages: atomicwrites                                                                                           
Could not install packages due to an EnvironmentError: [Errno 13] Permissão negada: '/usr/lib/python3.6/site-packages/atomicwrites-1  
.1.5.dist-info'                                                                                                                       
Consider using the `--user` option or check the permissions.                                                                          
                                                                                                                                        
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

~/foo $ ls .venv/bin
activate  activate.csh  activate.fish  python  python3
@cauebs
Copy link
Contributor Author

cauebs commented May 31, 2018

I should add that, if I create a venv manually (python -m venv .venv) before trying anything, poetry detects it and everything works as expected.

@cauebs cauebs closed this as completed Jun 3, 2018
@cauebs
Copy link
Contributor Author

cauebs commented Jun 6, 2018

I think now I've isolated the problem. If I install poetry with pipsi, it will fail to link pip. If I install with get-poetry.py (by adding --user somewhere in it) it works fine afterward.

@cs01
Copy link

cs01 commented Jun 6, 2018

Is the fix something poetry needs to add or pipsi?

@Victor-Savu
Copy link

@cauebs I added the --user flag to get-poetry.py in PR #146. Would you mind giving it a try and letting me know if it solves the problem?

@cauebs
Copy link
Contributor Author

cauebs commented Jun 6, 2018

@Victor-Savu It does, I've already tried it and commented there :)

@Victor-Savu
Copy link

Thanks!

@cauebs
Copy link
Contributor Author

cauebs commented Jun 18, 2018

@cs01 I honestly have no idea. Poetry appears to be doing everything right (creating the venv with EnvBuilder(with_pip=True).create()).

@cauebs
Copy link
Contributor Author

cauebs commented Jun 28, 2018

Ok, the pipsi available on PyPI is outdated (for almost three years, now) and shouldn't be used. That version always uses virtualenv instead of venv, even on python 3, and that's why poetry couldn't properly create virtualenvs. I installed pipsi from the git repo, installed poetry with it, and everything is fine.

Copy link

github-actions bot commented Mar 3, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants