I am trying to install deeptools on an Anaconda2 prompt for Python 3.7 and 2.7 by following this tutorial.
First, I got an environment error which I solved by running the following:
$ conda create --name dianaenv python=2.7
$ conda activate dianaenv
$ conda config --add channels bioconda
$ conda install -c bioconda deeptools
But now I get the error below when running the last conda install:
The error: Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: / Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort.- failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Package vs2008_runtime conflicts for: python=2.7 -> vs2008_runtime Package sqlite conflicts for: python=2.7 -> sqlite[version='>=3.25.3,<4.0a0|>=3.26.0,<4.0a0|>=3.27.2,<4.0a0|>=3.30.1,<4.0a0'] Package pysam conflicts for: deeptools -> pysam[version='>=0.14.0'] Package vc conflicts for: python=2.7 -> vc[version='9.*|>=9,<10.0a0'] Package deeptoolsintervals conflicts for: deeptools -> deeptoolsintervals[version='>=0.1.8'] Package matplotlib conflicts for: deeptools -> matplotlib[version='>=2.1.1|>=3.0.0'] Package pybigwig conflicts for: deeptools -> pybigwig[version='>=0.2.3'] Package ca-certificates conflicts for: python=2.7 -> ca-certificates Package scipy conflicts for: deeptools -> scipy[version='>=0.17.0'] Package py2bit conflicts for: deeptools -> py2bit[version='>=0.2.0'] Package plotly conflicts for: deeptools -> plotly[version='>=1.9.0|>=2.0.0'] Package pip conflicts for: python=2.7 -> pip Package numpy conflicts for: deeptools -> numpy[version='>=1.9.0'] Package pandas conflicts for: deeptools -> pandas
I also tried to install the requirements individually and installing numpy, scipy and matplotlib. Which all worked fine. But when I try to install py2bit, pybigwig or pysam, I also get the following errors:
$ pip install py2bit
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Collecting py2bit Using cached https://files.pythonhosted.org/packages/53/bb/547a927bed736ead3dc909e1e552d57c9034bb9493eff80544c0cf6e4828/py2bit-0.3.0.tar.gz Building wheels for collected packages: py2bit Building wheel for py2bit setup.py) ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\User\Anaconda2\envs\dianaenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\user\appdata\local\temp\pip-install-6nxreu\py2bit\setup.py'"'"'; file='"'"'c:\users\user\appdata\local\temp\pip-install-6nxreu\py2bit\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'c:\users\user\appdata\local\temp\pip-wheel-vrkfci' --python-tag cp27 cwd: c:\users\user\appdata\local\temp\pip-install-6nxreu\py2bit\ Complete output (21 lines): C:\Users\User\Anaconda2\envs\dianaenv\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'classifier' warnings.warn(msg) running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-2.7 creating build\lib.win-amd64-2.7\py2bitTest copying py2bitTest\test.py -> build\lib.win-amd64-2.7\py2bitTest copying py2bitTest__init__.py -> build\lib.win-amd64-2.7\py2bitTest running egg_info writing py2bit.egg-info\PKG-INFO writing top-level names to py2bit.egg-info\top_level.txt writing dependency_links to py2bit.egg-info\dependency_links.txt reading manifest file 'py2bit.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'py2bit.egg-info\SOURCES.txt' copying py2bitTest\foo.2bit -> build\lib.win-amd64-2.7\py2bitTest running build_ext building 'py2bit' extension error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
ERROR: Failed building wheel for py2bit Running setup.py clean for py2bit Failed to build py2bit Installing collected packages: py2bit Running setup.py install for py2bit ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\User\Anaconda2\envs\dianaenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\user\appdata\local\temp\pip-install-6nxreu\py2bit\setup.py'"'"'; file='"'"'c:\users\user\appdata\local\temp\pip-install-6nxreu\py2bit\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'c:\users\user\appdata\local\temp\pip-record-xmdylh\install-record.txt' --single-version-externally-managed --compile cwd: c:\users\user\appdata\local\temp\pip-install-6nxreu\py2bit\ Complete output (21 lines): C:\Users\User\Anaconda2\envs\dianaenv\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'classifier' warnings.warn(msg) running install running build running build_py creating build creating build\lib.win-amd64-2.7 creating build\lib.win-amd64-2.7\py2bitTest copying py2bitTest\test.py -> build\lib.win-amd64-2.7\py2bitTest copying py2bitTest__init__.py -> build\lib.win-amd64-2.7\py2bitTest running egg_info writing py2bit.egg-info\PKG-INFO writing top-level names to py2bit.egg-info\top_level.txt writing dependency_links to py2bit.egg-info\dependency_links.txt reading manifest file 'py2bit.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'py2bit.egg-info\SOURCES.txt' copying py2bitTest\foo.2bit -> build\lib.win-amd64-2.7\py2bitTest running build_ext building 'py2bit' extension error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27 ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Users\User\Anaconda2\envs\dianaenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\user\appdata\local\temp\pip-install-6nxreu\py2bit\setup.py'"'"'; file='"'"'c:\users\user\appdata\local\temp\pip-install-6nxreu\py2bit\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'c:\users\user\appdata\local\temp\pip-record-xmdylh\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Also, if I try to use pip install I get the following matplotlib error:
$ pip install --user deeptools
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Collecting deeptools Using cached https://files.pythonhosted.org/packages/82/8e/d9d4b66b2ce1bd48f1db43357c8eb019ae3e8bb1bb7a9e82667db981e1df/deepTools-3.3.1.tar.gz Collecting numpy>=1.9.0 Downloading https://files.pythonhosted.org/packages/48/83/203c397ecec78bdd618a0fb04a47482cfa2ae5ea2c6d428ed94258fe8671/numpy-1.16.5-cp27-cp27m-win_amd64.whl (11.9MB) |UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU| 11.9MB 2.5MB/s Collecting scipy>=0.17.0 Downloading https://files.pythonhosted.org/packages/49/73/22e125f335986fdc3b03c09cdf8ffe0d9d5471eec301aeb2e33db78b3e7f/scipy-1.2.2-cp27-cp27m-win_amd64.whl (30.5MB) |UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU| 30.5MB 187kB/s ERROR: Could not find a version that satisfies the requirement matplotlib>=3.0.0 (from deeptools) (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3, 2.2.4) ERROR: No matching distribution found for matplotlib>=3.0.0 (from deeptools)
I tried uninstalling and reinstalling anaconda and other packages, but it does not work.
Q: How do I resolve a UnsatisfiableError when installing deeptools?
Judging by the vs2008_runtime, this is a Windows system, however, Bioconda only supports Unix and Linux. Moreover, deeptools requires deeptools-intervals which also only supports Unix and Linux.
I don't work with Windows, but I've heard good things about Windows Subsystem for Linux (WSL). That way, you could install a Linux version of Conda (as in this article). Though for scientific work I'd strongly encourage installing Miniconda instead of Anaconda.
Related
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\KimXD\\AppData\\Local\\Temp\\pip-install-7pjpmdge\\bitarray_3a1e8028774c4a059cdba67b160795fd\\setup.py'"'"'; __file__='"'"'C:\\Users\\KimXD\\AppData\\Local\\Temp\\pip-install-7pjpmdge\\bitarray_3a1e8028774c4a059cdba67b160795fd\\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'"'"'))' install --record 'C:\Users\KimXD\AppData\Local\Temp\pip-record-f8bq9svc\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\KimXD\AppData\Roaming\Python\Python39\Include\bitarray'
cwd: C:\Users\KimXD\AppData\Local\Temp\pip-install-7pjpmdge\bitarray_3a1e8028774c4a059cdba67b160795fd\
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\bitarray
copying bitarray\test_bitarray.py -> build\lib.win-amd64-3.9\bitarray
copying bitarray\test_util.py -> build\lib.win-amd64-3.9\bitarray
copying bitarray\util.py -> build\lib.win-amd64-3.9\bitarray
copying bitarray\__init__.py -> build\lib.win-amd64-3.9\bitarray
running build_ext
building 'bitarray._bitarray' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\bitarray
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Program Files\Python39\include -IC:\Program Files\Python39\include /Tcbitarray/_bitarray.c /Fobuild\temp.win-amd64-3.9\Release\bitarray/_bitarray.obj
error: command 'cl.exe' failed: None
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\KimXD\\AppData\\Local\\Temp\\pip-install-7pjpmdge\\bitarray_3a1e8028774c4a059cdba67b160795fd\\setup.py'"'"'; __file__='"'"'C:\\Users\\KimXD\\AppData\\Local\\Temp\\pip-install-7pjpmdge\\bitarray_3a1e8028774c4a059cdba67b160795fd\\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'"'"'))' install --record 'C:\Users\KimXD\AppData\Local\Temp\pip-record-f8bq9svc\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\KimXD\AppData\Roaming\Python\Python39\Include\bitarray' Check the logs for full command output.
I assume you were trying to install web3 using the pip command python -m pip install web3 (or pip install web3 for short, although the first form is better). I got roughly the same error when performing this command.
The problem isn't in web3, however, but in one of its dependencies. You can check this by installing it with --no-deps, which works fine:
C:\temp\stack_overflow>pip install --no-deps web3
Collecting web3
Using cached web3-5.24.0-py3-none-any.whl (487 kB)
Installing collected packages: web3
Successfully installed web3-5.24.0
But this probably doesn't solve your problem, because the module likely doesn't work without all its dependencies. The dependency that is failing in this case is bitarray. This is because bitarray is a source package. The documentation of this library contains installation instructions:
If you have a working C compiler, you can simply:
$ pip install bitarray
If you rather want to use precompiled binaries, you can:
conda install bitarray (both the default Anaconda repository as well as conda-forge support bitarray)
download Windows wheels from Chris Gohlke
I did the last step: downloading the wheel from the mentioned website, and installing it with pip install bitarray-2.3.4-cp38-cp38-win_amd64.whl (your version may be different of course). This worked like a charm.
However, web3 also has a dependency on lru-dict, which resulted in the same issue. Unfortunately, I could not find pre-compiled binaries for this package, so if you encounter the same problem, you now have two options:
Use conda-forge to install your packages. I personally don't have experience with conda, but conda-forge seems to support the lru-dict package (as well as the above-mentioned bitarray package).
Make sure to install Microsoft Visual C++ 14.0 or greater. As mentioned in the error message: Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
This page contains some more detailed instructions on how to download and install it.
I got it working by updating the Visual C++ compiler to the latest version and make sure to include the Windows 10 SDK, as explained in this SO answer.
(venv) C:\temp\stack_overflow>python.exe -m pip install web3
Collecting web3
Using cached web3-5.24.0-py3-none-any.whl (487 kB)
(...lots of lines listing requirements already satisfied...)
Building wheels for collected packages: lru-dict, bitarray
Building wheel for lru-dict (setup.py) ... done
Created wheel for lru-dict: filename=lru_dict-1.1.7-cp39-cp39-win_amd64.whl size=12711 sha256=a6ccbda691f0a941591c1b9c1ae24a5a4ee26d726685f2e71aa382e5b77a3d65
Stored in directory: c:\users\wovano\appdata\local\pip\cache\wheels\86\3f\f6\6efebdbc72403e91c39f8cc817f61627d065eed97921b8e5b8
Building wheel for bitarray (setup.py) ... done
Created wheel for bitarray: filename=bitarray-1.2.2-cp39-cp39-win_amd64.whl size=55817 sha256=a03c3e6ac482b1cbe4adce197f0bd4333c7094af2d785f5575bdff16a024710d
Stored in directory: c:\users\wovano\appdata\local\pip\cache\wheels\f6\b3\8d\0bb7212600c4671dcb713dec6574c37b118c2c321e6ed52fe3
Successfully built lru-dict bitarray
Installing collected packages: bitarray, attrs, async-timeout, websockets, pywin32, protobuf, lru-dict, jsonschema, ipfshttpclient, eth-account, aiohttp, web3
Successfully installed aiohttp-3.7.4.post0 async-timeout-3.0.1 attrs-21.2.0 bitarray-1.2.2 eth-account-0.5.6 ipfshttpclient-0.8.0a2 jsonschema-3.2.0 lru-dict-1.1.7 protobuf-3.18.1 pywin32-302 web3-5.24.0 websockets-9.1
NB: It is recommended to install web3 in a clean virtual environment, to avoid version conflicts with other installed modules.
Let me tell you one perfect solution for such problems. It is always better to have a virtual environment which solves the version problems of the different problems ... you may follow the below process and it will help
# Install pip if it is not available:
$ which pip || curl https://bootstrap.pypa.io/get-pip.py | python
# Install virtualenv if it is not available:
$ which virtualenv || pip install --upgrade virtualenv
# *If* the above command displays an error, you can try installing as root:
$ sudo pip install virtualenv
# Create a virtual environment:
$ virtualenv -p python3 ~/.venv-py3
# Activate your new virtual environment:
$ source ~/.venv-py3/bin/activate
# With virtualenv active, make sure you have the latest packaging tools
$ pip install --upgrade pip setuptools
# Now we can install web3.py...
$ pip install --upgrade web3
I have an equal problem and I resolved with anaconda.
First check your Microsoft Visual C++, install and restart your computer.
Second, you should watch a some Anaconda's tutorial, after that, you need to create a virtual environment, pick the folder and done.
Example in code : In to cmd
1) conda create --name 'pick a name'
2) conda activate 'yourname'
3) conda install -c conda-forge web3
After that, go to your text editor and pick how python interpreter (alt+shift+p in VSC), the one you already created like ENVS, look in C:\Users'youruser'.conda\envs'yournameENVS.
I cannot install psycopg2 on my M1 Mac and I used pip3.
When I tried to install with pip3 install psycopg2 The output like that:
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/python#3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-install-9wiqe2nr/psycopg2_147a5ae8fd5a47079480274f4225edbf/setup.py'"'"'; __file__='"'"'/private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-install-9wiqe2nr/psycopg2_147a5ae8fd5a47079480274f4225edbf/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 /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-06hnnl2t
cwd: /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-install-9wiqe2nr/psycopg2_147a5ae8fd5a47079480274f4225edbf/
Complete output (23 lines):
running egg_info
creating /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-06hnnl2t/psycopg2.egg-info
writing /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-06hnnl2t/psycopg2.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-06hnnl2t/psycopg2.egg-info/dependency_links.txt
writing top-level names to /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-06hnnl2t/psycopg2.egg-info/top_level.txt
writing manifest file '/private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-06hnnl2t/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>).
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fd/ae/98cb7a0cbb1d748ee547b058b14604bd0e9bf285a8e0cc5d148f8a8a952e/psycopg2-2.8.6.tar.gz#sha256=fb23f6c71107c37fd667cb4ea363ddeb936b348bbd6449278eb92c189699f543 (from https://pypi.org/simple/psycopg2/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached psycopg2-2.8.5.tar.gz (380 kB)
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/python#3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-install-9wiqe2nr/psycopg2_97efcf6747c249769acdc8430ba4238f/setup.py'"'"'; __file__='"'"'/private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-install-9wiqe2nr/psycopg2_97efcf6747c249769acdc8430ba4238f/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 /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-ap2am61r
cwd: /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-install-9wiqe2nr/psycopg2_97efcf6747c249769acdc8430ba4238f/
Complete output (23 lines):
running egg_info
creating /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-ap2am61r/psycopg2.egg-info
writing /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-ap2am61r/psycopg2.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-ap2am61r/psycopg2.egg-info/dependency_links.txt
writing top-level names to /private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-ap2am61r/psycopg2.egg-info/top_level.txt
writing manifest file '/private/var/folders/m5/vhnyyjg16gd352x6wdhpjysh0000gn/T/pip-pip-egg-info-ap2am61r/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>).
==============================================================================
Its beginning of the error, After that its tried to install each previous version of Psycopg
==============================================================================
Also, I tried to install with source code with :
git clone https://github.com/psycopg/psycopg2.git
cd psycopg2
python3 setup.py build
Its return as error like that:
running build
running build_py
running build_ext
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>).
Also
python3 setup.py build
return the same error as python3 setup.py build
How can I install it?
try this:
brew install libpq --build-from-source
brew install openssl
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib -L/opt/homebrew/opt/libpq/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include -I/opt/homebrew/opt/libpq/include"
pip3 install psycopg2
Before reverting to any of the older answers, I would recommend trying the following:
Install Postgres using brew install postgres, then pip3 install psycopg2.
Worked on Mac M1, Monterey, Python 3.9.
Thanks to Kori Vernon.
Thanks to active development, now there is a new release of psycopg2 as well as psycopg2-binary which is compatible with M1 devices.
Ver. 2.9.1 works smooth. Tried and tested
Reference - https://github.com/psycopg/psycopg2/issues/1200
Following this steps solved my problem:
❯ brew install postgresql#14
# If you open a new terminal tab you will see that pg_config is available
❯ export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
❯ export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib -L${HOME}/.pyenv/versions/3.10.7/lib" # use your current python version
❯ python -V
Python 3.10.7 # make sure it matches the same above configuration
❯ pip install psycopg2-binary==2.8.5
Installation of Twisted==17.9.0 fails on Python 3.7.3. Also can't install Cryptography==2.1.4
Want to install necessary modules on Pycharm for python-binance
I've tried using the anaconda version of python but with that I still get the install error with cryptography.
C:\Users\Laptop\PycharmProjects\Python Trading2\venv\Scripts>pip install Twisted==17.9.0
Collecting hyperlink>=17.1.1 (from Twisted==17.9.0)
Using cached https://files.pythonhosted.org/packages/7f/91/e916ca10a2de1cb7101a9b24da546fb90ee14629e23160086cf3361c4fb8/hyperlink-19.0.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in c:\program files\python37\lib\site-packages (from zope.interface>=4.0.2->Twisted==17.9.0) (39.0.1)
Collecting attrs>=16.1.0 (from Automat>=0.3.0->Twisted==17.9.0)
Using cached https://files.pythonhosted.org/packages/23/96/d828354fa2dbdf216eaa7b7de0db692f12c234f7ef888cc14980ef40d1d2/attrs-19.1.0-py2.py3-none-any.whl
Requirement already satisfied: six in c:\program files\python37\lib\site-packages (from Automat>=0.3.0->Twisted==17.9.0) (1.12.0)
Requirement already satisfied: idna>=2.5 in c:\program files\python37\lib\site-packages (from hyperlink>=17.1.1->Twisted==17.9.0) (2.8)
Installing collected packages: zope.interface, constantly, incremental, attrs, Automat, hyperlink, Twisted
Running setup.py install for Twisted ... error
ERROR: Complete output from command 'c:\program files\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Laptop\\AppData\\Local\\Temp\\pip-install-x06wgdqo\\Twisted\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Laptop\AppData\Local\Temp\pip-record-jhd2kvhg\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\twisted
copying src\twisted\copyright.py -> build\lib.win-amd64-3.7\twisted
copying src\twisted\plugin.py -> build\lib.win-amd64-3.7\twisted
copying src
And on and on in red.
Today I encountered the same problem Tried everything. Then everything made sense.
Install VSC build tools:
https://learn.microsoft.com/en-us/answers/questions/136595/error-microsoft-visual-c-140-or-greater-is-require.html
Download https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted (if you get .whl error)(file name "Twisted-20.3.0-cp39-cp39-win_amd64.whl" ). install it using CMD location/filename.
Install through cmd:
pip Install Scrapy
I've been trying to install pycairo on a mac os x. I'm getting an error message,
Initially I was getting 'pkg-config' not found. After installing that through brew, I get Package cairo was not found in the pkg-config search path. In principle I could try to edit the search path, but since this is going through pip, I would have expected this to be all taken care of. Is there a way to tell pip to put the stuff where pkg-config knows to look?
Here's the full message.
> pip install pycairo
Collecting pycairo
Using cached https://files.pythonhosted.org/packages/48/20/5e83af98eb897935bf7dc39455e892ba866feebb9b7c3b392982866f9958/pycairo-1.18.1.tar.gz
Building wheels for collected packages: pycairo
Building wheel for pycairo (setup.py) ... error
ERROR: Complete output from command /Applications/anaconda/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/f2/bzrj46j11gzdk19j91tp1sq80000gq/T/pip-install-lahb8lq4/pycairo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/f2/bzrj46j11gzdk19j91tp1sq80000gq/T/pip-wheel-scnvplas --python-tag cp36:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/cairo
copying cairo/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/cairo
copying cairo/__init__.pyi -> build/lib.macosx-10.7-x86_64-3.6/cairo
copying cairo/py.typed -> build/lib.macosx-10.7-x86_64-3.6/cairo
running build_ext
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for pycairo
I get the same error if I use pip to install an older version.
There is a similar question here: How can I fix the problem when installing pycairo on windows?, but it's related to Windows, and the error looks to be different to me (also I'm not satisfied by the answer).
Any suggestion for how to fix this?
I ran into this issue too.
I am using Q4OS(Debian), and do not have brew.
Here is these steps I manage to solve this issue.
sudo apt-get update -y
sudo apt-get install -y pkg-config
sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev
sudo pip install pycairo
I could solve the issue with the help of the comments from the question. In summary:
brew install pkg-config
brew install cairo
pip install pycairo
I was trying to install the jsonlib in python using pip install, but the error keeps coming
I've tried installing the Visual Studio C++ redis. 2015-2019.
It did nothing.
Using cached https://files.pythonhosted.org/packages/7c/55/19c29fd79dfb5d42f4568feedc5a286d01d0683a372c1e19024531576508/jsonlib-1.6.1.tar.gz
Building wheels for collected packages: jsonlib
Building wheel for jsonlib (setup.py) ... error
ERROR: Complete output from command 'c:\users\satyam porwal\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Satyam Porwal\\AppData\\Local\\Temp\\pip-install-w6n5pwbu\\jsonlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Satyam Porwal\AppData\Local\Temp\pip-wheel-l33ly_ta' --python-tag cp37:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying jsonlib.py -> build\lib.win-amd64-3.7
running build_ext
building '_jsonlib' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for jsonlib
Running setup.py clean for jsonlib
Failed to build jsonlib
Installing collected packages: jsonlib
Running setup.py install for jsonlib ... error
I expected to install the json
pipwin installs unofficial python package binaries for windows
provided by Christoph Gohlke here
pip install pipwin
pipwin install jsonlib
This worked for python 3.x oon windows
pip install pipwin
pipwin install jsonlib-python3