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

PR #1697 makes pip install --editable . not work #1977

Closed
siddalmia opened this issue Apr 7, 2020 · 7 comments
Closed

PR #1697 makes pip install --editable . not work #1977

siddalmia opened this issue Apr 7, 2020 · 7 comments
Assignees

Comments

@siddalmia
Copy link
Contributor

🐛 Bug

Hi pyproject.toml introduced in #1697 makes the installation of fairseq using pip install --editable . not work. Even though I am using conda.

@myleott
Copy link
Contributor

myleott commented Apr 7, 2020

It works for me. What error do you see?

@siddalmia
Copy link
Contributor Author

Hi Myle,
I have copied the error below -

    ERROR: Command errored out with exit status 1:
     command: /opt/conda/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'~/sdalmia/fairseq/setup.py'"'"'; __file__='"'"'~/sdalmia/fairseq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
         cwd: ~/sdalmia/fairseq/
    Complete output (28 lines):
    running develop
    WARNING: The user site-packages directory is disabled.
    error: can't create or remove files in install directory

    The following error occurred while trying to add or remove files in the
    installation directory:

        [Errno 13] Permission denied: '/opt/conda/lib/python3.6/site-packages/test-easy-install-19568.write-test'

    The installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:

        /opt/conda/lib/python3.6/site-packages/

    Perhaps your account does not have write access to this directory?  If the
    installation directory is a system-owned directory, you may need to sign in
    as the administrator or "root" account.  If you do not have administrative
    access to this machine, you may wish to choose a different installation
    directory, preferably one that is listed in your PYTHONPATH environment
    variable.

    For information on other options, you may wish to consult the
    documentation at:

      https://setuptools.readthedocs.io/en/latest/easy_install.html

    Please make the appropriate changes for your system and try again.

    ----------------------------------------

@myleott
Copy link
Contributor

myleott commented Apr 10, 2020

Seems like you don't have the right permissions. Try pip install --user . && pip install --user --editable .

@myleott myleott closed this as completed Apr 10, 2020
@siddalmia
Copy link
Contributor Author

Hi @myleott ,

Thanks but I already tried that.

I am running them on docker inside a conda and without that file the pip install --editable . works just fine. But it doesn't seem to work with your --user solution. In fact pip install . seems to be working but not the --editable option.

Thanks

@alexforencich
Copy link

Ran in to this issue myself due to having a blank pyproject.toml. When attempting to run pip install -e . or pip install --user -e ., pip detects that it isn't running as root (Defaulting to user installation because normal site-packages is not writeable) but then somehow forgets that it is supposed to be installing for the user instead of for the system, and fails with the previously-mentioned error. Deleting the empty pyproject.toml fixed the problem and allowed pip install -e . to work correctly. Now, if you need pyproject.toml for some reason, then presumably python expects to see something in particular in that file, unfortunately I'm not sure what that would be.

@Logicbloke
Copy link

Following the tip from @agoose77, I'm putting this in my setup.py as a workaround:

import site
import sys
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
...

Originally posted by @joshbode in pypa/pip#7953 (comment)

@DarrenCook
Copy link

DarrenCook commented Feb 10, 2021

@myleott I tried this:

pip3 install --user . && pip3 install --user --editable .

I ran the commands separately, and the first one works, the second one fails with the same error as described by other people here.

I then edited setup.py as described above by @Logicbloke , adding those three lines at the very top. After that, doing pip3 install --user --editable . worked.

Python 3.8.5, pip 20.0.2, pytorch 1.7.1, fresh ubuntu 20.04 server.

pypa/pip#7953 also mentioned --no-use-pep517 but I didn't try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants