I got following error when I am trying to install python-igraph using sudo pip install python-igraph
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZHOdbM/python-igraph/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-MGaN23-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ZHOdbM/python-igraph/
I also try to install C core using the link given in the answer UnicodeDecodeError when installing python-igraph
I would suggest you to use conda and the following command :
conda install -c conda-forge python-igraph
https://anaconda.org/conda-forge/python-igraph
Related
New to python and just trying pip install python-docx and getting this message:
Command "C:\Users\samue\PycharmProjects\testings\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file
__='C:\Users\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml\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\samue\AppData\Local\Temp\pip-record-pg5bpdaa\install-record.txt --single-version-externally-managed --com
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\bin\Hos
tX86\x86\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Users\samue\PycharmProjects\testings\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users
\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().re
place('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\samue\AppData\Local\Temp\pip-reco
rd-pg5bpdaa\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\samue\PycharmProjects\te
stings\venv\include\site\python3.8\lxml" failed with error code 1 in C:\Users\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml
\
When you install with pip you use the command pip and not python.
To see whether pip is correctly installed type:
pip help
See the following page for how to install and configure pip on Windows:
https://phoenixnap.com/kb/install-pip-windows
Your error output shows a problem with lxml. Looking into it I have found the page pip install lxml error which suggests the following solution:
sudo apt-get install --reinstall python-dev libpython2.7-dev.
I was using the mysql-connector 2.1.8 for a while and out of a sudden, it was no longer available.
Could not find a version that satisfies the requirement mysql-connector==2.1.8 (from versions: 2.2.8)
I tried installing some newer versions, like 2.2.5. Which literally worked once and then didn't on a server.
And the latest version 2.2.8 gives an error like this:
Collecting mysql-connector==2.2.8
Using cached https://files.pythonhosted.org/packages/8e/78/049f747325ce0154263cd1b10fe7ea9ddb17e839111c6f8f824d5964cfb5/mysql-connector-2.2.8.tar.gz
Installing collected packages: mysql-connector
Running setup.py install for mysql-connector ... error
Complete output from command /home/liudas/PycharmProjects/eneba_what_place/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7rlbpvfn/mysql-connector/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-kbw8r138/install-record.txt --single-version-externally-managed --compile --install-headers /home/liudas/PycharmProjects/eneba_what_place/venv/include/site/python3.6/mysql-connector:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized
pip install -U setuptools wheel
Newer package version might require newer features of setuptools or wheel, so it's what causes --single-version-externally-managed not recognized
A good thing to keep such core packages up to date, plus they are almost always backwards compatible.
On Mac OS Sierra, created virtualenv using python2.7 and trying to install mysqlclient to use Django w/ MySQL. I installed MySQL 5.6 via homebrew. Running "pip install mysqlclient" gives these errors:
Running setup.py bdist_wheel for mysqlclient ... error
...
13 warnings generated.
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql56/5.6.32/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-intel-2.7/_mysql.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
Failed building wheel for mysqlclient
Command "...env2.7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/nm/mqfwjt115q7g0lpvnx7sylwm0000gn/T/pip-build-tJmAVS/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/nm/mqfwjt115q7g0lpvnx7sylwm0000gn/T/pip-xVuIu1-record/install-record.txt --single-version-externally-managed --compile --install-headers .../env2.7/include/site/python2.7/mysqlclient" failed with error code 1 in /private/var/folders/nm/mqfwjt115q7g0lpvnx7sylwm0000gn/T/pip-build-tJmAVS/mysqlclient/
Any help would be greatly appreciated.
The answer was installing dev tools using:
xcode-select --install
In my case I needed to do two steps:
xcode-select --install
as #howevilweare says AND also pip install with the brew installed openssl using an env command:
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install mysqlclient
The error is -
Loading command: install (LoadError) cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError) undefined method
`invoke_with_build_args' for nil:NilClass
Please tell the possible reason for this error and help in resoving it.
The same problem is discussed here. It is also solved. Their findings might help you:
https://github.com/jekyll/jekyll-help/issues/55
From the link:
Great! It's all working! I followed this steps:
First i removed all previously installed rubies on my OS.
And next this:
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
gem install jekyll
I installed django 1.8.5 in virtualenv and using python 3.4.3
the worked displayed the it works page when using sqlite
I wanted to use mysql and I'm trying to install mysqlclient using
pip install mysqlclient
and I'm getting the following message
----------------------------------------
Failed building wheel for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient
Complete output from command /home/sasidhar/django/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5lj39q67/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-da2_35zs-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sasidhar/django/env/include/site/python3.4/mysqlclient:
running install
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.4/MySQLdb
running build_ext
building '_mysql' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,6,'final',1) -D__version__=1.3.6 -I/usr/include/mysql -I/usr/include/python3.4m -I/home/sasidhar/django/env/include/python3.4m -c _mysql.c -o build/temp.linux-x86_64-3.4/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -DNDEBUG
_mysql.c:40:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/sasidhar/django/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5lj39q67/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-da2_35zs-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sasidhar/django/env/include/site/python3.4/mysqlclient" failed with error code 1 in /tmp/pip-build-5lj39q67/mysqlclient
I did try installing libraries suggested in error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
and still the problem persists
please help me solve this problem
Thanks guys!!
You need to install python-dev:
sudo apt-get install python-dev
And, since you are using python3:
sudo apt-get install python3-dev
This command should help you.
If you are using mac os you might try:
brew update && brew rm python3 && brew install python3
You need to brew has been installed already, otherwise you can install it. It is very useful for getting packages in Mac OS. http://brew.sh/
For Ubuntu you also need to install build-essential
sudo apt-get install build-essential
For those using different versions, such as Python 3.5, 3.6 or 3.7 I found this:
Part I
For Python 2.x use:
$ sudo apt-get install python-dev
For Python 2.7 use:
$ sudo apt-get install libffi-dev
For Python 3.x use:
$ sudo apt-get install python3-dev
For Python 3.4 use:
$ sudo apt-get install python3.4-dev
For Python 3.7 use:
$ sudo apt-get install python3.7-dev
Part II
If this still doesn't help, others have pointed out to install
$ sudo apt-get install build-essential
and finally
$ sudo apt-get install libssl-dev
But the last two didn't help me personally. Just in case, hope it helps you.
For those using python3.5:
apt-get install python3.5-dev
wget https://bootstrap.pypa.io/get-pip.py
python3.5 get-pip.py
pip3.5 install mysqlclient
Tried all of the above suggestions and a few found elsewhere and nothing worked. In the end the solution was simple enough (courtesy of ignacionf on GitHub):
pip install git+https://github.com/PyMySQL/mysqlclient-python.git