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

pip install with user mode and editable fails with python 3.10 #10766

Closed
1 task done
jinserk opened this issue Jan 8, 2022 · 9 comments
Closed
1 task done

pip install with user mode and editable fails with python 3.10 #10766

jinserk opened this issue Jan 8, 2022 · 9 comments
Labels
resolution: not a bug Determined as not a bug in pip resolution: wrong project Should be reported elsewhere

Comments

@jinserk
Copy link

jinserk commented Jan 8, 2022

Description

When I tried to install with --no-use-pep517 option, it fails in the TEST step as:

    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/mpiuser/c2tk/setup.py'"'"'; __file__='"'"'/home/mpiuser/c2tk/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
         cwd: /home/mpiuser/c2tk/
    Complete output (38 lines):
    running develop
    /home/mpiuser/.local/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /home/mpiuser/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /usr/bin/python -E -c pass
    TEST FAILED: /home/mpiuser/.local/lib/python3.1/site-packages does NOT support .pth files
    bad install directory or PYTHONPATH
    
    You are attempting to install a package to a directory that is not
    on PYTHONPATH and which Python does not read ".pth" files from.  The
    installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:
    
        /home/mpiuser/.local/lib/python3.1/site-packages
    
    and your PYTHONPATH environment variable currently contains:
    
        '/home/mpiuser/.local/lib/python3.10/site-packages:/usr/lib/python3/dist-packages:'
    
    Here are some of your options for correcting the problem:
    
    * You can choose a different installation directory, i.e., one that is
      on PYTHONPATH or supports .pth files
    
    * You can add the installation directory to the PYTHONPATH environment
      variable.  (It must then also be on PYTHONPATH whenever you run
      Python and want to use the package(s) you are installing.)
    
    * You can set up the installation directory to support ".pth" files by
      using one of the approaches described here:
    
      https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#custom-installation-locations
    
    
    Please make the appropriate changes for your system and try again.
    running egg_info
    error: [Errno 13] Permission denied
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/mpiuser/c2tk/setup.py'"'"'; __file__='"'"'/home/mpiuser/c2tk/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.

Interestingly, the reason of the failure is that it recognizes user local path with python3.1 instead of python3.10.

Expected behavior

No response

pip version

21.3.1

Python version

3.10.1

OS

archlinux

How to Reproduce

pip install --user --no-use-pep517 -e .

Output

No response

Code of Conduct

@jinserk jinserk added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 8, 2022
@pradyunsg
Copy link
Member

pradyunsg commented Jan 8, 2022

This error originates out of the package being installed, and is not a bug in pip -- rather this is a failure in the package's build system that is being reported by pip.

Please look up to the documentation of the package in question, or reach out to the maintainers of the corresponding package.

@jinserk
Copy link
Author

jinserk commented Jan 8, 2022

@pradyunsg Thanks for the prompt reply. I am the package author but the only python version specification on my setup files is in setup.cfg:

[options]
python_requires = >=3.9

Is this problematic?

@uranusjr
Copy link
Member

uranusjr commented Jan 8, 2022

    You are attempting to install a package to a directory that is not
    on PYTHONPATH and which Python does not read ".pth" files from.  The
    installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:
    
        /home/mpiuser/.local/lib/python3.1/site-packages
    
    and your PYTHONPATH environment variable currently contains:
    
        '/home/mpiuser/.local/lib/python3.10/site-packages:/usr/lib/python3/dist-packages:'

Since distutils is managed by newer versions of setuptools, it may be worthwhile to ask the setuptools developers.

@jinserk
Copy link
Author

jinserk commented Jan 8, 2022

I'm not sure but this could be the problem of python 3.10:

$ python
Python 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from platform import python_version
>>> python_version()
'3.10.1'
>>> python_version() < "3.5"
True
>>> python_version() < "3.10"
False
>>> python_version() < "3.1"
False
>>> python_version() < "3.2"
True
>>> 

@pradyunsg
Copy link
Member

/cc @jaraco

@pradyunsg pradyunsg added resolution: wrong project Should be reported elsewhere resolution: not a bug Determined as not a bug in pip and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Jan 8, 2022
@jaraco
Copy link
Member

jaraco commented Jan 8, 2022

I believe this is the same issue reported in pypa/setuptools#3001. Try the 60.4 release and see if it fixes it for you.

@jinserk
Copy link
Author

jinserk commented Jan 9, 2022

@jaraco Thank you for the comment! I updated setuptools to 60.5.0 then at least the truncated version issue has gone:

[mpiuser@942db5331027 c2tk]$ python                                                                                                                                                                                                                                            
Python 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0] on linux                                                                                                                                                                                                              
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> setuptools.__version__
'60.5.0'
>>> 

however, I met another permission denied error as:

[mpiuser@942db5331027 c2tk]$ pip install --no-use-pep517 -e .
Looking in links: http://download.pytorch.org/whl/cpu/torch_stable.html, http://download.pytorch.org/whl/cu113/torch_stable.html
Obtaining file:///home/mpiuser/c2tk
  Preparing metadata (setup.py) ... done
Requirement already satisfied: ase in /home/mpiuser/.local/lib/python3.10/site-packages (from c2tk==0.0.1) (3.22.1)
Requirement already satisfied: gpaw in /home/mpiuser/.local/lib/python3.10/site-packages (from c2tk==0.0.1) (21.6.0)
Requirement already satisfied: matscipy in /home/mpiuser/.local/lib/python3.10/site-packages (from c2tk==0.0.1) (0.7.0)
Requirement already satisfied: plams in /home/mpiuser/.local/lib/python3.10/site-packages (from c2tk==0.0.1) (1.5.1)
Requirement already satisfied: pyamg in /home/mpiuser/.local/lib/python3.10/site-packages (from c2tk==0.0.1) (4.2.1)
Requirement already satisfied: rdkit-pypi in /home/mpiuser/.local/lib/python3.10/site-packages (from c2tk==0.0.1) (2021.9.3)
Requirement already satisfied: numpy>=1.15.0 in /home/mpiuser/.local/lib/python3.10/site-packages (from ase->c2tk==0.0.1) (1.22.0)
Requirement already satisfied: matplotlib>=3.1.0 in /home/mpiuser/.local/lib/python3.10/site-packages (from ase->c2tk==0.0.1) (3.5.1)
Requirement already satisfied: scipy>=1.1.0 in /home/mpiuser/.local/lib/python3.10/site-packages (from ase->c2tk==0.0.1) (1.7.3)
Requirement already satisfied: dill>=0.2.4 in /home/mpiuser/.local/lib/python3.10/site-packages (from plams->c2tk==0.0.1) (0.3.4)
Requirement already satisfied: pytest>=2 in /home/mpiuser/.local/lib/python3.10/site-packages (from pyamg->c2tk==0.0.1) (6.2.5)
Requirement already satisfied: packaging>=20.0 in /usr/lib/python3.10/site-packages (from matplotlib>=3.1.0->ase->c2tk==0.0.1) (20.9)
Requirement already satisfied: pillow>=6.2.0 in /home/mpiuser/.local/lib/python3.10/site-packages (from matplotlib>=3.1.0->ase->c2tk==0.0.1) (9.0.0)
Requirement already satisfied: pyparsing>=2.2.1 in /usr/lib/python3.10/site-packages (from matplotlib>=3.1.0->ase->c2tk==0.0.1) (2.4.7)
Requirement already satisfied: fonttools>=4.22.0 in /home/mpiuser/.local/lib/python3.10/site-packages (from matplotlib>=3.1.0->ase->c2tk==0.0.1) (4.28.5)
Requirement already satisfied: python-dateutil>=2.7 in /home/mpiuser/.local/lib/python3.10/site-packages (from matplotlib>=3.1.0->ase->c2tk==0.0.1) (2.8.2)
Requirement already satisfied: cycler>=0.10 in /home/mpiuser/.local/lib/python3.10/site-packages (from matplotlib>=3.1.0->ase->c2tk==0.0.1) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/mpiuser/.local/lib/python3.10/site-packages (from matplotlib>=3.1.0->ase->c2tk==0.0.1) (1.3.2)
Requirement already satisfied: py>=1.8.2 in /home/mpiuser/.local/lib/python3.10/site-packages (from pytest>=2->pyamg->c2tk==0.0.1) (1.11.0)
Requirement already satisfied: toml in /usr/lib/python3.10/site-packages (from pytest>=2->pyamg->c2tk==0.0.1) (0.10.2)
Requirement already satisfied: attrs>=19.2.0 in /home/mpiuser/.local/lib/python3.10/site-packages (from pytest>=2->pyamg->c2tk==0.0.1) (21.4.0)
Requirement already satisfied: iniconfig in /home/mpiuser/.local/lib/python3.10/site-packages (from pytest>=2->pyamg->c2tk==0.0.1) (1.1.1)
Requirement already satisfied: pluggy<2.0,>=0.12 in /home/mpiuser/.local/lib/python3.10/site-packages (from pytest>=2->pyamg->c2tk==0.0.1) (1.0.0)
Requirement already satisfied: six>=1.5 in /usr/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib>=3.1.0->ase->c2tk==0.0.1) (1.16.0)
Installing collected packages: c2tk
  Running setup.py develop for c2tk
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/mpiuser/c2tk/setup.py'"'"'; __file__='"'"'/home/mpiuser/c2tk/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
         cwd: /home/mpiuser/c2tk/
    Complete output (7 lines):
    running develop
    /home/mpiuser/.local/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /home/mpiuser/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running egg_info
    error: [Errno 13] Permission denied
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/mpiuser/c2tk/setup.py'"'"'; __file__='"'"'/home/mpiuser/c2tk/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output

@jaraco
Copy link
Member

jaraco commented Jan 9, 2022

I'm sorry to hear that. Can you please create a new issue and describe steps to reproduce it?

@jinserk
Copy link
Author

jinserk commented Jan 9, 2022

@jaraco I opened pypa/setuptools#3019. Thank you so much again!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: not a bug Determined as not a bug in pip resolution: wrong project Should be reported elsewhere
Projects
None yet
Development

No branches or pull requests

4 participants