psycopg2 installing error in cPanel while hosting Django Website with PostgreSQL - python

Collecting psycopg2
Using cached psycopg2-2.9.3.tar.gz (380 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
running egg_info
creating /tmp/pip-pip-egg-info-irgb8yga/psycopg2.egg-info
writing /tmp/pip-pip-egg-info-irgb8yga/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-irgb8yga/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-irgb8yga/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-irgb8yga/psycopg2.egg-info/SOURCES.txt'
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
[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.

As recommended in the log try using psycopg2-binary as package not psycopg2.
That's how I use it and it's working on all different environments.

Related

I was deploying my python ML project on Heroku, got these errors

while I was developing in the Build main section got these errors
Collecting importlib==1.0.4
Downloading importlib-1.0.4.zip (7.1 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status '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.
! Push rejected, failed to compile Python app.
! Push failed
I can see in the error this line: ERROR: Can not execute setup.py since setuptools is not available in the build environment which means you haven't added the setuptools module to the build environment of the project. Try to use pip install setuptools to install the module.

Failed building wheel for minepy

I'm using windows 10 and Python 3.8.10. When I try to install minepy module via "pip install minepy", I get an error as following:
pip install minepy
C:\Users\sotka>pip install minepy
Collecting minepy
Using cached minepy-1.2.6.tar.gz (496 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.3.0 in c:\users\sotka\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from minepy) (1.18.1)
Building wheels for collected packages: minepy
Building wheel for minepy (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\minepy
copying minepy\__init__.py -> build\lib.win-amd64-cpython-38\minepy
running build_ext
building 'minepy.mine' extension
error: [WinError 2] The system cannot find the file specified
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for minepy
Running setup.py clean for minepy
Failed to build minepy
Installing collected packages: minepy
Running setup.py install for minepy ... error
error: subprocess-exited-with-error
× Running setup.py install for minepy did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running install
C:\Users\sotka\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\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 build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\minepy
copying minepy\__init__.py -> build\lib.win-amd64-cpython-38\minepy
running build_ext
building 'minepy.mine' extension
error: [WinError 2] The system cannot find the file specified
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> minepy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
What I have already tried:
updated pip, python
updated visual studio build tools
manually installed the module by copying the files to where the other modules are
manually downloaded unofficial minepy module and installed
No luck so far. I'd use some help. Thanks in advance

Can't install psycopg2 - Can not execute `setup.py`

I am trying to run the below command on Linux
pip3.9 install psycopg2
but it does not work as I get the following error message:
Collecting psycopg2
Using cached psycopg2-2.9.3.tar.gz (380 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
I have been looking at a bunch of other SO questions but nothing has worked thus far. e.g. running
pip3.9 install setuptools
returns an already satisfied requirement message.
Any help greatly appreciated.
Thanks

How to fix: ERROR: Failed building wheel for fastobo

I am trying to install this library nxontology using the command below:
pip install nxontology
It is giving me the error below:
Building wheel for fastobo (pyproject.toml) ... error
error: subprocess-exited-with-error
Building wheel for fastobo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
running bdist_wheel
running build
running build_py
package init file 'src\py\__init__.py' not found (or not a regular file)
package init file 'src\py\header\__init__.py' not found (or not a regular file)
package init file 'src\py\instance\__init__.py' not found (or not a regular file)
package init file 'src\py\term\__init__.py' not found (or not a regular file)
package init file 'src\py\typedef\__init__.py' not found (or not a regular file)
running build_ext
running build_rust
creating build
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\cargo
creating build\temp.win-amd64-cpython-310\Release\rustup
downloading rustup.sh install script
installing Rust compiler to build\temp.win-amd64-cpython-310\Release
error: [WinError 2] The system cannot find the file specified
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for fastobo
Failed to build fastobo
ERROR: Could not build wheels for fastobo, which is required to install pyproject.toml-based projects
I saw some answers to similar errors but none of them worked for me.
pip version: pip 22.1.1 from C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)
Project python interpreter: Python 3.9.
I would really appreciate if you have any idea how to fix this.

installing fuse-python on windows

I'm getting this error egg:info error
Collecting fuse-python
Using cached fuse-python-1.0.5.tar.gz (49 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
The system cannot find the path specified.
The system cannot find the path specified.
pkg-config unavailable, build terminated
[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.
I did try to make this install from Pypi site.
after a closer look i've found that egg_info file is almost empty no version info.
how to solve it......Thanks for your time.

Categories