Can't pip install from source #21

Closed
opened 2022-01-25 12:29:07 +00:00 by aurelien-lourot · 7 comments
aurelien-lourot commented 2022-01-25 12:29:07 +00:00 (Migrated from gitlab.com)

pip install pylspci works well but pip install --no-binary :all: pylspci fails with

Collecting pylspci
  Downloading pylspci-0.4.0.tar.gz (25 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-2f66_gem
         cwd: /tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/setup.py", line 11, in <module>
        requirements = read_requirements('requirements.txt')
      File "/tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/setup.py", line 8, in read_requirements
        return [req.strip() for req in open(filename)]
    FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
`pip install pylspci` works well but `pip install --no-binary :all: pylspci` fails with ``` Collecting pylspci Downloading pylspci-0.4.0.tar.gz (25 kB) ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-2f66_gem cwd: /tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/ Complete output (7 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/setup.py", line 11, in <module> requirements = read_requirements('requirements.txt') File "/tmp/pip-install-evl_ddiy/pylspci_a29f4fda78a84818813644c20ef7b1a8/setup.py", line 8, in read_requirements return [req.strip() for req in open(filename)] FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt' ```
aurelien-lourot commented 2022-01-25 12:35:11 +00:00 (Migrated from gitlab.com)

Workaround: pip install --no-binary :all: git+https://gitlab.com/Lucidiot/pylspci

Workaround: `pip install --no-binary :all: git+https://gitlab.com/Lucidiot/pylspci`
Lucidiot commented 2022-01-26 18:18:09 +00:00 (Migrated from gitlab.com)

mentioned in merge request !19

mentioned in merge request !19
Lucidiot commented 2022-01-26 18:19:26 +00:00 (Migrated from gitlab.com)

mentioned in commit 27cc5de1b9

mentioned in commit 27cc5de1b9d53d9db0a4f1c5571846a83a114ae8
Lucidiot commented 2022-01-26 18:23:48 +00:00 (Migrated from gitlab.com)

Thanks for the report! I released v0.4.1 which should fix this issue.

Thanks for the report! I released v0.4.1 which should fix this issue.
aurelien-lourot commented 2022-02-08 14:16:53 +00:00 (Migrated from gitlab.com)

Thank you, it seems now to be hitting the same issue on another file:

Collecting pylspci
  Downloading pylspci-0.4.1.tar.gz (25 kB)
    ERROR: Command errored out with exit status 1:
     command: /root/parts/charm/build/staging-venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9hablc27/pylspci/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9hablc27/pylspci/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-9hablc27/pylspci/pip-egg-info
         cwd: /tmp/pip-install-9hablc27/pylspci/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-9hablc27/pylspci/setup.py", line 16, in <module>
        version=open('VERSION').read().strip(),
    FileNotFoundError: [Errno 2] No such file or directory: 'VERSION'
Thank you, it seems now to be hitting the same issue on another file: ``` Collecting pylspci Downloading pylspci-0.4.1.tar.gz (25 kB) ERROR: Command errored out with exit status 1: command: /root/parts/charm/build/staging-venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9hablc27/pylspci/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9hablc27/pylspci/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-9hablc27/pylspci/pip-egg-info cwd: /tmp/pip-install-9hablc27/pylspci/ Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-9hablc27/pylspci/setup.py", line 16, in <module> version=open('VERSION').read().strip(), FileNotFoundError: [Errno 2] No such file or directory: 'VERSION' ```
Lucidiot commented 2022-02-08 22:03:52 +00:00 (Migrated from gitlab.com)

I have tried to run ./setup.py sdist multiple times in different environments and got random results, sometimes the VERSION was included, sometimes not. The logs always indicated VERSION was included, but it wasn't always in the generated archive. I looked through the setuptools docs and the repo to see if anything could explain while the file would go missing, but couldn't find anything. So I just went with the brute way and duplicated everything between the MANIFEST.in and the package_data inside setup.py, and it seems to include the various data files more reliably now…

You can try again with v0.4.2!

I have tried to run `./setup.py sdist` multiple times in different environments and got random results, sometimes the `VERSION` was included, sometimes not. The logs always indicated `VERSION` was included, but it wasn't always in the generated archive. I looked through [the setuptools docs](https://setuptools.pypa.io/en/latest/userguide/datafiles.html#data-files-support) and [the repo](https://github.com/pypa/setuptools/) to see if anything could explain while the file would go missing, but couldn't find anything. So I just went with the brute way and duplicated everything between the `MANIFEST.in` and the `package_data` inside `setup.py`, and it seems to include the various data files more reliably now… You can try again with v0.4.2!
aurelien-lourot commented 2022-02-10 11:26:28 +00:00 (Migrated from gitlab.com)

This worked for me, thanks a lot!

This worked for me, thanks a lot!
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lucidiot/pylspci#21
No description provided.