installing python-ldap on windows with cygwin (fails on gcc) - python

I have a virtual windows machine where I'm trying to install Python packages.
I've never used Windows before, so I started by installing Cygwin and used that to install the other packages I'd need.
At first I tried installing Python2.7 from Python.org, but eventually read that it was better for using GCC to use the one from Cygwin.
$ python -c "import math; print math.sqrt(4)" # seems like all is well
Here's the install line (setup-x86_64.exe is the Cygwin installer binary):
$ ./setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P python2.7
$ pip --version
pip 9.0.1 from /usr/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)
$ which python
/usr/bin/python
$ which pip
/usr/bin/pip
$ which g++
/usr/bin/g++
$ which gcc
/usr/bin/gcc
Then I ran the following:
$ pip install python-ldap
...lots of lines...
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-D1mVYX/python-ldap/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-3_5lF9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-D1mVYX/python-ldap/
This is weird since I know (from above) that gcc & g++ are working just fine!
Anyone know how I can install python-ldap properly with pip?
Thanks!

Related

Can't install PyArrow on Ubuntu

I have an EC2 Ubuntu 18.04.3 LTS instance with python 3.6.9
I tried to install pyarrow with this command:
python3 -m pip install pyarrow
But I get an error:
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;
__file__='/tmp/pip-build-3q5nmx81/pyarrow/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-fgafmfzg-record/install-record.txt
--single-version-externally-managed --compile --user --prefix="
failed with error code 1 in /tmp/pip-build-3q5nmx81/pyarrow/
Reading the first messages after trying to install yarrow I see this:
Building wheels for collected packages: pyarrow
Running setup.py bdist_wheel for pyarrow ... error
Please, do you know how I can solve this issue? Thank you in advance.
If you are working in a virtual environment, it is likely that your pip version is the default one (9.0.1). Try to upgrade it with pip install --upgrade pip and run the command python3 -m pip install pyarrow again.
Tested under Ubuntu 18.04, with Python 3.6.9 and pyarrow==4.0.0

Installing requirements.txt throws an error on Django

The project was working perfectly until recently when I created a model for my database and tried to pip install requirement.txt. I have done everything I know including modifying my settings.py to add the missing library, reinstalling django and psycopg2, all to no avail. Here's my requirement.txt:
tweepy==3.8.0
django
gunicorn
django-heroku
The error i'm getting:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/apple/Downloads/font_text/python-getting-started/getting-started/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-install-phi9wroh/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-record-sc3y24vo/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apple/###/###/PROJECTFOLDER/getting-started/include/site/python3.7/psycopg2" failed with error code 1 in /private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-install-phi9wroh/psycopg2/
Based on the error message, you need to install the openssl-devel package on your system.
After long hours of searching and experimenting, I finally was able to solve the problem. But I'm still investigating on what really could have caused the error. Anyways, here's what fixed it
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
pip install psycopg2
I found it here: error installing psycopg2, library not found for -lssl
You need to reinstall gcc , gcc-c++ and dependencies.
For python 2.7
$ sudo yum -y install gcc gcc-c++ kernel-devel
$ sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
$ pip install "your python packet"
For python 3.4
$ sudo apt-get install python3-dev
$ pip install "your python packet"
Hope this will help.

Error installing module with pip on Ubuntu 15.10

I have trouble installing modules using pip, for example
sudo -H pip3 install kivy
returns this error
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b3rwh_e6/kivy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bev6v2mx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-b3rwh_e6/kivy/
I am fairly new to python and to programming in general so I'm probably doing something wrong, it's probably worth mentioning that I have python2.7 and python3.5 installed, and installing the packages python3.5-dev and build-essential didn't fix it.
Edit: build log:
https://drive.google.com/file/d/0B5e3GD1lfCbUZ19LU3RENzY4MU0/view?usp=sharing
Packages which include C extensions require compilation and so might require both gcc and python-dev (and in some cases gcc-c++).
run:
sudo apt-get install gcc python-dev
prior to pip installing your package.
Have you tried to install
sudo apt-get install python-dev
for python2.7 ?
From the official site
https://kivy.org/docs/installation/installation-linux.html
for python 2
sudo apt-get install python-kivy
for python 3
sudo apt-get install python3-kivy

fatal error: 'openssl/e_os2.h' file not found in pypy

When I Run Command pypy -m pip install cryptography
then I have got below Errors:
cc -arch x86_64 -O2 -fPIC -Wimplicit -I/opt/pypy-5.0.1/include -c build/temp.macosx-10.10-x86_64-2.7/_openssl.c -o build/temp.macosx-10.10-x86_64-2.7/build/temp.macosx-10.10-x86_64-2.7/_openssl.o
build/temp.macosx-10.10-x86_64-2.7/_openssl.c:423:10: fatal error: 'openssl/e_os2.h' file not found
#include
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/pypy -u -c "import setuptools, tokenize;file='/private/var/folders/_t/8l_tq9210xl4bzlhkspnv8br0000gn/T/pip-build-Gjhf5l/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/_t/8l_tq9210xl4bzlhkspnv8br0000gn/T/pip-6_y8I9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_t/8l_tq9210xl4bzlhkspnv8br0000gn/T/pip-build-Gjhf5l/cryptography/
On OS X PyPy you'll need to brew install openssl (or port install or whatever) and then run the following command:
LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography
If you use ports modify the paths to point at the proper location.
if you pc is mac,please configure as follows:
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include
and amazingly,it works fine for me.
Cryptography requires compiling C Extensions.
Depending on the the platform you're on, you should install python-dev and gcc prior to installing cryptography:
debian: sudo apt-get install python-dev gcc
rhel: sudo yum install python-devel gcc
windows: you need to install the Python C++ Runtime (https://www.microsoft.com/en-us/download/details.aspx?id=44266)

Error installing PyObjc: command '/usr/bin/clang' failed

I've been working on a python script, first using the Psychopy compiler, which already included all I needed, but now I need to make it the more independent as possible. I have the script working on a Windows computer, but I also want it to work in OSX.
The script uses pyglet and I followed this post in order to install it. However, when I reach the latest step, which is installing PyObjc, I have the following error:
40 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Cleaning up...
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/fk/1plt8wj53_d183pv59scmg4m0000gn/T/pip_build_JL/pyobjc-core/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/fk/1plt8wj53_d183pv59scmg4m0000gn/T/pip-HfEjaW-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/fk/1plt8wj53_d183pv59scmg4m0000gn/T/pip_build_JL/pyobjc-core
Storing debug log for failure in /Users/JL/.pip/pip.log
Why does this error appears? What can I do to solve it?
Terminal post:
xcode-select --install
may be can help you.
Try installing pyobjc separately first.
On OSX 10.7 or 10.8, try:
env CC=clang pip -U pyobjc-core
env CC=clang pip -U pyobjc
On OSX 10.9, try:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pyobjc

Categories