I need to install pycurl in order to run a python script, but I can't find the way to do it on macOS.
I have already tried brew, update Pip but I always receive this error after did "pip install pycurl"
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/vk/f193293d0pvd2ynlcpnyx9100000gn/T/pip-install-rxidIQ/pycurl/setup.py", line 913, in <module>
ext = get_extension(sys.argv, split_extension_source=split_extension_source)
File "/private/var/folders/vk/f193293d0pvd2ynlcpnyx9100000gn/T/pip-install-rxidIQ/pycurl/setup.py", line 582, in get_extension
ext_config = ExtensionConfiguration(argv)
File "/private/var/folders/vk/f193293d0pvd2ynlcpnyx9100000gn/T/pip-install-rxidIQ/pycurl/setup.py", line 99, in __init__
self.configure()
File "/private/var/folders/vk/f193293d0pvd2ynlcpnyx9100000gn/T/pip-install-rxidIQ/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.
Any suggestion ?
Recent versions of curl support multiple ssl backend and pycurl is not able to decide which one is used during the installation time. This is a known problem (https://github.com/pycurl/pycurl/issues/530) in 7.43.0.2. Lots of people say to install curl with openssl support, but on macos is better to use the default SecureTransport and let the system access the keychain instead of using the bundled certificates in openssl.
Try installing 7.43.0.1 to fix your problems.
pip install pycurl==7.43.0.1
If this doesn't work execute this:
brew link curl
export LDFLAGS="-L/usr/local/opt/curl/lib"
export CPPFLAGS="-I/usr/local/opt/curl/include"
and try again
pip install pycurl==7.43.0.1
In order for PycURL to find the OpenSSL headers on macOS, we need to specify which SSL backend to use and where OpenSSL can be found:
pip install --install-option="--with-openssl" --install-option="--openssl-dir=/usr/local/opt/openssl" pycurl
That OpenSSL path will vary based on your installation. On Apple Silicon, this should work:
pip install --install-option="--with-openssl" --install-option="--openssl-dir=/opt/homebrew/opt/openssl" pycurl
Related
For context, I'm trying to point pip at the directory that PyCharm is using. Running OSX High Sierra. Google hasn't had any answers yet (As far as I can tell).
In the command line, if I enter
pip install SpeechRecognition -t /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4/site-packages
It gives me
OSError: [Errno 20] Not a directory
If I try
pip install SpeechRecognition -t /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4/
I get
ERROR: Target path exists but is not a directory, will not continue.
I tried updating pip, and still no luck. What should I try next?
The target dir you're trying to specify is incorrect - it should be
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages
(lib dir instead of bin that stores the executables).
However, it looks like you are trying to install into the python dist's default site packages dir - you shouldn't need to explicitly specify the target dir in this case. Instead, use the correct pip executable:
$ pip3.4 install SpeechRecognition
If pip3.4 executable is not available, use the one bundled with Python 3.4:
$ python3.4 -m pip install SpeechRecognition
I am on AWS Ec2 Amazon Linux and trying to use Let's Encrypt. When I first installed Let's Encrypt couple month back I did not have any issues renewing the certificates. But now I receive this error and not able to renew.
# ./certbot-auto --debug
Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt:
Traceback (most recent call last):
File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 7, in <module>
from certbot.main import main
File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/main.py", line 7, in <module>
import zope.component
File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope/component/__init__.py", line 16, in <module>
from zope.interface import Interface
ImportError: No module named interface
I have tried unset PYTHON_INSTALL_LAYOUT and upgrading pip,virtualenv. No luck.
It seems to be simialr to this issue Letsencrypt ImportError: No module named interface on amazon linux while renewing But dirctory is different. Not sure I want to rm the /opt/eff.org/certbot/venv/bin/letsencrypt
I was able to fix this problem with:
sudo rm -rf /root/.local/share/letsencrypt/
sudo rm -rf /opt/eff.org/certbot/
Then rerun certbot-auto in user mode (ec2-user).
./certbot-auto renew -v --debug
I hit exactly this issue just now with Amazon Linux. The fix that worked for me is detailed on the certbot GitHub issue
I had the same issue from what appears to be a bad install of certbot.
I fixed it by running the following:
unset PYTHON_INSTALL_LAYOUT
/root/.local/share/letsencrypt/bin/pip install --upgrade certbot
I did not have pip installed separately on the server, it was only available as part of the certbot install, so this was the only way I could use pip to upgrade the installation properly.
If you have pip installed on your EC2 instance as I do, you can simply do this:
rm -rf /opt/eff.org/*
pip install -U certbot
certbot renew --debug
Downloading certbot-auto via wget has always caused problems for me, so the above method is preferred.
Error I am get when trying to start cql Shell
>cqlsh
CQL Shell supports only Python 2.7
>
I have installed python2.7 but it is still giving the same error.
do i have to set path some were?
i have installed Cassandra 2.2 from datastax suing this command
sudo yum install dsc22
Depending on your distribution and its version you cannot change the default python version of the system without breaking the system. If you have Python 2.7 installed then its interpreter is probably on your path as python2.7.
Try running python2.7 --version. If that gives you an output like Python 2.7.x you are good. Just edit the cqlsh script and replace python with python2.7 at the beginning of the only code line in the file.
You should use python 2.7 but be aware of https://issues.apache.org/jira/browse/CASSANDRA-11850
Not enough rep to post as a comment. If you encounter same problem as #andrewdeal and you installed Python 2.7 side-by-side (a must on CentOS 6 which requires Python 2.6), you need site-packages in your Python 2.7 install.
As root:
rm /usr/local/lib/python2.7/site-packages/README
rmdir /usr/local/lib/python2.7/site-packages
ln -s /usr/lib/python2.7/site-packages/ /usr/local/lib/python2.7
You can now run cqlsh
I tried doing that change from python to python2.7 and then got:
Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 152, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling
ImportError: No module named cqlshlib
After I have upgraded to El Capitan, Python 2.7 is unable to install/ upgrade/ uninstall some packages, but meanwhile, it still works fine for some other packages.
Below (the end) is the error message I have got when trying to upgrade numpy. Same error also raises when I tried to uninstall it.
I have tried pip install --user or pip install --ignore-installed numpy, but neither works. Even if it says numpy has been successfully installed, the version remains unchanged and it does not really upgrade.
I know other solutions may be reinstall python using brew, but I want to avoid multiple versions of Python if possible. Any help would be appreciated.
----------- Error Message -----------
40:523: execution error: The directory '/Users/-/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/init.py", line 315, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/m0/hzt3nk9d43n05bwm6zztqjkh0000gn/T/pip-HESb5m-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
(2)
The python framework you are using
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7"
is the system python that comes with your mac os. You shouldn't pip install packages as doing so may pollute your system python and potentially cause system problems. This is why other solutions suggest installing another python such as from brew brew install python#2.
The issue you are running into after upgrading to el capitan is the System Integrity Protection built-in OS X El Capitan and later
You can disable this protection by following the steps described here:
https://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html
After doing so, you will be able to install and upgrade packages using pip.
I do not recommend this, but it will work!
I suggest installing python using brew and then setup a virtual environment using pip such that you can install python packages that won’t pollute the global python.
pip install virtualenv
pip install virtualenvwrapper
I'm very new to Python and using the terminal, and I'm having a lot of trouble downloading wxpython. I'm using Mac OS X Lion, the most recent version, and I've tried two methods:
If I try to simply download wxpython off their website, I go through the entire installation process and it says it's been installed but then I can't find it on my computer. And when I go to run the separately installed demo, it says that there's no module named wxpython on my computer.
So I turned to other methods...
If I try sudo pip install wxpython, I get:
Downloading/unpacking wxpython
Downloading wxPython2.8-win64-devel-2.8.12.1-msvc9x64.tar.bz2 (7.2Mb): 7.2Mb downloaded
Running setup.py egg_info for package wxpython
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory: '/Users/michelletyler1/build/wxpython/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory: '/Users/michelletyler1/build/wxpython/setup.py'
I also tried sudo port install py27-wxpython after installing MacPorts, and got:
---> Computing dependencies for py27-wxpython
---> Building py27-wxpython
Error: org.macports.build for port py27-wxpython returned: command execution failed
Please see the log file for port py27-wxpython for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-wxpython/py27-wxpython/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port py27-wxpython failed
What can be wrong?
Also, I've been trying to figure out how to change my $PATH so that /usr/local/bin is ahead of /usr/bin (as advised by brew doctor), but when I go to edit my ~/.profile (what I've gathered I'm supposed to do from what I've found online so far), it doesn't work.
Thanks for the help!
From what I understand, you don't want to install wxPython against the preinstalled Python. Instead, you need to go to www.python.org and install a fresh Mac compatible Python. Then you can download the wxPython you want and install it against your fresh Python. By the way, wxPython does not support easy_install or pip.