pyjson5
pyjson5 copied to clipboard
Unable to install, complains setuptools not available
I'm unable to install json5. I'm using Python 3.9.5, and tryin 3.9.13 next.
$ /home/user/.cache/pypoetry/virtualenvs/jupyterops-qDA-38_b-py3.9/bin/pip install setuptools json5
Requirement already satisfied: setuptools in /home/user/.cache/pypoetry/virtualenvs/jupyterops-qDA-38_b-py3.9/lib/python3.9/site-packages (60.6.0)
Collecting json5
Using cached json5-0.9.8.tar.gz (22 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Whoops, sorry for not replying earlier :(.
Can you install setuptools first, and then try to install json5? I've never actually seen a situation where you had pip
installed but not setuptools
: I would've assumed that pip depended on setuptools.
If there's no way to avoid the simultaneous install, let me know and I'll see if I can dig into it some more.
Trying to install in Python 3.8.5 and get the identical error. I've got setuptools
available in my virtual environment and updated pip
and tried again.
Then I ran python -c 'import setuptools'
and got an ImportError
, both in the virtual environment and outside it:
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
This is in Manjaro Linux in WSL2. I've got libffi
3.4.2-5 installed but I'm not sure if this is really a setuptools
issue or something else. I haven't run into this problem previously, and the other 77 modules I just installed in this virtual environment installed without issue. I guess they're not using setuptools
.
EDIT: Installed libffi.so.7
and json5
installed correctly.
Then I ran python -c 'import setuptools' and got an ImportError
I'm afraid I don't know how to help here, sorry. I don't know how packages would get imported via pip
if you don't have a working copy of setuptools
, and as far as I know, best practice for distributing packages in Python is to use pip
.
If you haven't already done so, you might want to check https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-requirements and see if you can do everything there successfully.
That said, I'm far from an expert in publishing packages. If someone can point me at instructions for distributing and installing things using Python (as opposed to distro-native means like rpms, debs, homebrew recipes, etc.) that doesn't rely on pip and setuptools, I'd be happy to look at them. I have little interest in building packages distributed via native mechanisms myself; I don't really have the time or inclination to ramp up on N different packaging schemes. If someone else wants to work on that, I'd be happy to consider including them in this project (but I won't guarantee that I'll adopt it).
I've never run into this issue previously, and I certainly wouldn't expect anyone to try to maintain an arbitrary number of different packages. One is nice, thank you. :)
It might be that folks running into the ImportError
have updated and the version(s) of libffi
was overwritten, but as I mention in my edit I just made sure that particular library was correctly installed and everything worked perfectly. I'm hoping that also helps @mcint.
I'm going to close this as not able to reproduce, but anyone should feel free to reopen if they're seeing this issue as well.
Any hints as to how this might be reproducible would be appreciated!