Trouble in installation pycurl - python

I really have trouble installing pycurl on my Mac, spent few hours trying solve it but unfortunately I did not find any useful solution.
When I execute: pip install pycurl or pip3.6 install pycurl
I got the following error:
Collecting pycurl
Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz
Complete output from command python setup.py egg_info:
Using curl-config (libcurl 7.54.0)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/setup.py", line 913, in <module>
ext = get_extension(sys.argv, split_extension_source=split_extension_source)
File "/private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/setup.py", line 582, in get_extension
ext_config = ExtensionConfiguration(argv)
File "/private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/setup.py", line 99, in __init__
self.configure()
File "/private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/setup.py", line 316, in configure_unix
specify the SSL backend manually.''')
__main__.ConfigurationError: Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using. Please see PycURL documentation for how to specify the SSL backend manually.
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/
Any help would be appreciated.

The previous answer didn't solve it for me exactly. I had to set LDFLAGS and CPPFLAGS first for it to build and thus install properly. brew install openssl alluded to these env vars and what they should be set to:
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include
pip install pycurl --with-openssl

According to the official doc. of pycurl
PycURL requires that the SSL library that it is built against is the same one libcurl, and therefore PycURL, uses at runtime. PycURL’s setup.py uses curl-config to attempt to figure out which SSL library libcurl was compiled against, however this does not always work.
I am not sure if this is the problem you having. But maybe you should try using --with-openssl to specify the SSL library to use.

Related

pip install setup.py missing when attemping install of pyodbc wheel file

i'm trying to update the pyodbc package from 4.0.16 to 4.0.22.
i dont have internet access on the machine i'm working on so downloaded the file and copied to across the network.
running
pip install S:\Temp\PMCD\pyodbc-4.0.22-py27hc56fc5f_0(1).tar.bz2
results in the following error:
Processing s:\temp\pmcd\pyodbc-4.0.22-py27hc56fc5f_0(1).tar.bz2
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'c:\\users\\adm_pa~2\\appdata\\local\\temp\\2\\pip-yf25bd-build\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\adm_pa~2\appdata\local\temp\2\pip-yf25bd-build\
setuptools has already been updated to latest(38.5.1) and pip as well (9.0.1)
i used pip to update setuptools and pip itself (via downloaded whl files), so i dont think pip is an issue.
i already managed to sucessfully upgrade pyodbc on my local machine from 16 to 22, so the whl file i have not sure whats going on.
Any ideas whats going on?
Could i manually unzip the package and place it directly in the site-packages? that didnt seem to do anything.
If your target machine does not have a direct Internet connection you can still install pyodbc by
using another machine to download the appropriate wheel (.whl) file from PyPI,
copying that file to your target machine (via LAN, SneakerNet, ...), and
using pip install <wheel_file_location>
For example,
pip install C:\__tmp\pyodbc-4.0.22-cp27-cp27m-win_amd64.whl
The naming convention for wheel files is described in PEP 491.
The 64-bit wheel files for Windows are tagged as "win_amd64" because that's what the Windows version of distutils reports as the platform:
>>> from distutils import util
>>> distutils.util.get_platform()
'win-amd64'

Install failed with Django-Chronograph by pip in django 1.10

Similar to this question but i got a different error.
I'm try to installing via pip with:
pip install django-chronograph
I'm using python 2.7 and a virtualenv
pip freeze
Django==1.10
django-backbone==0.2.3
django-jstemplate==1.1.1
gunicorn==18.0
MySQL-python==1.2.5
six==1.10.0
South==0.7.6
unicodecsv==0.9.4
Error:
pip install django-chronograph
Collecting django-chronograph
Using cached django-chronograph-0.3.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/setup.py", line 32, in <module>
setup_distribute()
File "/private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/setup.py", line 18, in setup_distribute
distribute_setup = __import__('distribute_setup')
File "distribute_setup.py", line 1
<html>
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/
The problem is with the installation script provided by django-chronograph.
In line 16 of setup.py, it tries to download a script:
https://bitbucket.org/wnielson/django-chronograph/src/f561106f6aaab62f2817e08e51c799320fd916d9/setup.py?at=default&fileviewer=file-view-default#setup.py-16
in this code block:
try:
import distribute_setup
except:
# Make sure we have Distribute
if not os.path.exists('distribute_setup'):
urllib.urlretrieve('http://nightly.ziade.org/distribute_setup.py',
'./distribute_setup.py')
However, when you visit the URL at http://nightly.ziade.org/distribute_setup.py, it gives a 404 error, thus the returned html in the error.
It looks like you might be able to get distribute here: https://pypi.python.org/pypi/distribute/0.7.3
Or try doing this before you install django-chronograph:
pip install distribute
Good luck!
django-chronograph is unmaintained. Its fork is doing much better and has support for Django 2.0 and Django 2.1: https://github.com/chrisspen/django-chroniker

IPTCInfo on Python 3.x Windows

I need to extract IPTC metadata from images. Most of the things I've read about Python packages on Windows suggest using pre-compiled binaries, but I don't see one for IPTCInfo, thus I tried pip3.
I'm getting an error from pip when trying to install this:
C:\Users\hackr>pip3 install IPTCInfo
Collecting IPTCInfo
Downloading IPTCInfo-1.9.5-6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo\setup.py", line 32
print self.get_archive_files()
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo
So, I tried to open that last temporary file it refrences, but it doesn't appear to exist...
I have the same problem. Appears the IPTCinfo is for python-2. I will upgrade IPTCinfo for python-3.
However I have found the library exvi2 which provides the same type of image support. There is a python interface for this at https://wiki.gnome.org/Projects/gexiv2
I maintain IPTCInfo3 in Pypi. I recommend downloading it via pip3 install iptcinfo3 as it is specifically upgraded for Python3x. Follow the readme and issue comments for examples. Enjoy.

Emacs deferred errors

I have installed the Emacs package jedi-emacs using M-x package install
and the following Python packages:
Jedi
EPC
argparse
using:
pip install --install-option="--prefix=~/.my_python_packages/" jedi
pip install --install-option="--prefix=/.my_python_packages/" epc
pip install --install-option="--prefix=/.my_python_packages/" argparse
since I do not have root priviledges.
When I open a Python file, I get the following error in the minibuffer, no matter where I place the cursor:
deferred error : (error Server may raise an error : Traceback (most recent call last):
File "/home/avazquez/.emacs.d/elpa/jedi-20130119.830/jediepcserver.py", line 261, in <module>
)
What could be causing it?
This is with Emacs 24.2.1
I found the solution to my problem. I did not have PYTHONPATH set up correctly (it should include the corresponding paths for /path/to/custom-packages).
For more info on this issue see the corresponding ticket in the package repository for emacs-jedi.

Installing SSL Module for Python (2.5.4) on Windows

since AppEngine requires to upload your apps via SSL I tried to install the module on my working laptop.
It is a x64 Win 7 System with Python 2.5.4 x86 installed.
I followed guides such as this one: How to install Python ssl module on Windows?
and also all related links.
But the major problem is, that neither MinGw nor GnuWin seems to really work.
GnuWin is perfectly installed, up to date and has all dependencies it needs to build the SSL module.
But typing in
> "C:\Python25\python.py" setup.py install -c mingw32
just badly fails.
So does "-cmingw32" and "-gnuwin32".
(-cmingw32 obviously fails, because even though MinGW is fully installed MinGw is not regcognized)
"build" instead of install seems to "output" something:
MinGw complains about "ggc no such file or directory", and with GnuWin "it doesn't know how to compile C/C++ on a nt with gnuwin"
This sounds like total garbage to me, because I did everything as described in the tutorials.
I fixed one part of my problem: gcc is now getting recognized by easy_install but AE still complains about the missing SSL module though both, easy_install and python say Pycrypto incl. SSL is successfully installed
easy_install ssl
C:\Users\faits>easy_install ssl
Searching for ssl
Best match: ssl 1.15
Adding ssl 1.15 to easy-install.pth file
Using c:\python25\lib\site-packages
Processing dependencies for ssl
Finished processing dependencies for ssl
easy_install pycrypto
C:\Users\faits>easy_install ssl
Searching for ssl
Best match: ssl 1.15
Adding ssl 1.15 to easy-install.pth file
Using c:\python25\lib\site-packages
Processing dependencies for ssl
Finished processing dependencies for ssl
python
IDLE 1.2.4
>>> import ssl
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import ssl
File "C:\Python25\lib\site-packages\ssl\__init__.py", line 61, in <module>
import _ssl2 # if we can't import it, let the error propagate
ImportError: No module named _ssl2
python
>>> import pycrypto
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pycrypto
ImportError: No module named pycrypto
I've summed up all the instructions nicely on the following link. Do check it out.
http://waqasshabbir.tumblr.com/post/18010535789/ssl-module-for-python-2-5-installation-windows-only
Use -c with the build command.
Compare:
$ python setup.py install -c
--compile (-c) compile .py to .pyc [default]
with:
$ python setup.py build -c
--compiler (-c) specify the compiler type
To find out other options , run:
$ python setup.py build --help

Categories