I am trying to install virtualenvwrapper and facing some problems..
Error:
error: /Library/Python/2.7/site-packages/virtualenvwrapper: Permission denied
Command /usr/bin/python -c "import setuptools;__file__='/Users/build/virtualenvwrapper/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /var/folders/x6/1rbbd59j1w7dx74lrrs181vh0000gn/T/pip-HQwbCQ-record/install-record.txt failed with error code 1 in /Users/build/virtualenvwrapper
How to solve this error?
Have you tried using the sudo command to run your command?
http://www.gratisoft.us/sudo/man/1.8.5/sudo.man.html
Related
I am trying to install psycopg2 using pip inside my virtualenv.
But, i am getting below error.
I already installed psycopg2-binary
but still i am getting below error.
Please suggest me a way to fic this issue.
errors:
(env) ➜ bootcamp git:(master) pip install psycopg2
Collecting psycopg2
Using cached psycopg2-2.8.6.tar.gz (383 kB)
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/soubhagyapradhan/Desktop/upwork/quinn/bootcamp/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p_/fpfgyxqd4054nrz482x5z3_m0000gn/T/pip-install-td3jkgfc/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/p_/fpfgyxqd4054nrz482x5z3_m0000gn/T/pip-install-td3jkgfc/psycopg2/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/p_/fpfgyxqd4054nrz482x5z3_m0000gn/T/pip-wheel-ops48_8u
cwd: /private/var/folders/p_/fpfgyxqd4054nrz482x5z3_m0000gn/T/pip-install-td3jkgfc/psycopg2/
Try upgrading pip with the following commands.
pip install -U pip
There are errors when I try to install psycopg2
pip install psycopg2
I don't know whether I have pg_config or not. I tried these to find out where is pg_config, psql. but I don't understand how pg_config is not in the system when I have installed PostgreSQL(11.4). And if it is there in the system how to set the PATH so that psycopg2 installation is possible.
(myvenv) [jpsofficedev#localhost djangogirls]$ postgres --version
postgres (PostgreSQL) 11.4
(myvenv) [jpsofficedev#localhost djangogirls]$ echo $PATH
/home/jpsofficedev/Documents/coding_for_girls/djangogirls/myvenv/bin:/home/jpsofficedev/.local/bin:/home/jpsofficedev/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin:/Library/PostgreSQL/11.4/bin
(myvenv) [jpsofficedev#localhost djangogirls]$ which psql
/usr/bin/psql
(myvenv) [jpsofficedev#localhost djangogirls]$ which pg_config
/usr/bin/which: no pg_config in (/home/jpsofficedev/Documents/coding_for_girls/djangogirls/myvenv/bin:/home/jpsofficedev/.local/bin:/home/jpsofficedev/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin:/Library/PostgreSQL/11.4/bin)
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
ERROR: Command errored out with exit status 1:
command: /home/jpsofficedev/Documents/coding_for_girls/djangogirls/myvenv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-w3r253fu/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-w3r253fu/psycopg2/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 pip-egg-info
cwd: /tmp/pip-install-w3r253fu/psycopg2/
Complete output (23 lines):
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/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
<http://initd.org/psycopg/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 19.2.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
This worked for me
sudo yum install python-devel postgresql-devel rpm-build
pip install psycopg2
As per suggested by one of the users, I used these commands and it worked for me.
sudo dnf install python-devel postgresql-devel rpm-build
pip install psycopg2
OP put this as a comment. It also worked for me. It would be best if you added this as an answer.
sudo yum install libpq-devel python-devel
When I try to build my docker-compose pdftotext seems to fail with this error:
Running setup.py install for pdftotext: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ihm5qxa9/pdftotext/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ihm5qxa9/pdftotext/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wa_n7pgk/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-ihm5qxa9/pdftotext/
Complete output (14 lines):
WARNING: pkg-config not found--guessing at poppler version.
If the build fails, install pkg-config and try again.
running install
running build
running build_ext
building 'pdftotext' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -I/usr/local/include/python3.6m -c pdftotext.cpp -o build/temp.linux-x86_64-3.6/pdftotext.o -Wall
pdftotext.cpp:3:10: fatal error: poppler/cpp/poppler-document.h: No such file or directory
#include <poppler/cpp/poppler-document.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
I've tested this on windows and linux with the same error. Has anyone found a fix for this?
Unfortunately, it is hard to help without knowing the content of your docker-compose/Dockerfile. But as mentioned in the error message, you are missing pkg-config. You should try to run apt-get install pkg-config.
You can also check my answer about how to use the latest version of the Poppler in the Docker.
ERROR: Complete output from command 'c:\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\SAADFA~1\\AppData\\Local\\Temp\\pip-install-by_eac52\\pyaudio\\s
etup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --recor
d 'C:\Users\SAADFA~1\AppData\Local\Temp\pip-record-lclkqelo\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
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'c:\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\SAADFA~1\\AppData\\Local\\Temp\\pip-install-by_eac52\\pyaudio\\setup.py'"'"';f=getattr(t
okenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SAADFA~1\App
Data\Local\Temp\pip-record-lclkqelo\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\SAADFA~1\AppData\Local\Temp\pip-install-by_eac52\
pyaudio\
I have installed Microsoft Visual C++ 14.0 but still get the error:
error: Microsoft Visual C++ 14.0 is required.
While installing jq on centos, I am experiencing an issue. I have run the following commands:
yum groupinstall "Development Tools"
yum install autoconf automake libtool python
after that I have used pip install jq and I was facing error like this:
jq.c:8:22: fatal error: pyconfig.h: No such file or directory
#include "pyconfig.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-akuaZu/jq/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read ().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))"
instal --record /tmp/pip-04CW9h-record/install-record.txt --single-version-externally
-managed --compile" failed with error code 1 in /tmp/pip-build-akuaZu/jq/
Can anyone help me??
Just in case if someone is looking for a different solution.
This is how I installed in Cent OS 7 and it worked. Ensure you have sudo privilege.
Installer solution
yum install epel-release -y
yum install jq -y
jq --version
output was jq-1.5
Reference
This is how I installed it on CentOS 7:
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -O jq
chmod +x jq
Then
mv jq /usr/local/bin
Install pre-req & install jq
$ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo yum install jq -y
more usage info.. https://medium.com/#gchandra/install-jq-on-centos-7-459dd650baa3