Trouble downloading wxpthon - terminal

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.

Related

Changing pip installation path; OSError: [Errno 20] Not a directory

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

pycurl macOS Install issue

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

Python 2.7 - unable to upgrade/ install some packages after upgrading to El Capitan

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

Can't install robotframework?

I've tried with these two ways:
pip install robotframework, return with below error:
Collecting robotframework Using cached robotframework-2.8.7.tar.gz
Complete output from command python setup.py egg_info: Traceback (most
recent call last): File "", line 20, in File
"C:\Users\wul5\AppData\Local\Temp\pip-build-
6d1rilfl\robotframework\setup.py", line 45 for directory in 'rebot',
'libdoc', 'testdoc', 'lib', 'common'
^ SyntaxError: invalid syntax
Command "python setup.py egg_info" failed with error code 1 in C:\Users\test\AppData\Local\Temp\pip-build-6d1rilfl\robotframework
Download the source file, and install with
python setup.py install, get below error:
File "setup.py", line 51 for directory in 'rebot', 'libdoc',
'testdoc', 'lib', 'common':
^ SyntaxError: invalid syntax
Anyone can help?
Follow the steps to install robotframework
Install Python 2.7.1
RIDE runs only on the regular Python, not on Jython nor IronPython.
Download Python 2.7.1
Install Python 2.7.1.
Set the path in environment variable. (Look below for instructions )
Note: Python 2.6 is the minimum version. Robot Framework, RIDE does not yet support Python3 .
Set path on Windows 8 (Windows 7 users also can try the steps)
Open Start
Type Environment Variables ( this will search directly )
Click on Edit the system environment variables
Goto Advanced tab
Click on Environment Variables button
Scroll down under System variables and click on Path
Click on Edit button
Append ;<InterpreterInstallationDir>;<InterpreterInstallationDir>\Scripts\ in variable value
Save the changes.
If command prompt is already open, then re-open command prompt to effectively take changes.
Install wxPython 2.8.12.1
It is necessary to install wxPython because RIDE’s GUI is implemented by using wxPython.
Download wxPython 2.8.12.1 directly from [here][1]
Run the installer and finish the setup.
This will install wxPython 2.8-win32-unicode-2.8.12.1 on your system.
Install PIP 1.1
To install PIP follow the step by step instruction provided here http://arunrocks.com/guide-to-install-python-or-pip-on-windows/
Install Robotframework 2.9rc1
Using Command Prompt
You can install RIDE by using the pip or easy_install commands.
Run either of the following command to install Robotframework:
pip install robotframework ride
easy_install robotframework ride
After the installation of RIDE, run the following command:
`ride.py` (this will launch RIDE )
Using Windows Installer
Download robotframework-RIDE 1.4:
You can download RIDE installer for windows version from
https://pypi.python.org/packages/source/r/robotframework-ride/robotframework-ride-1.4.tar.gz
Open the installer and follow the onscreen instructions.
After installation, launch RIDE by double clicking the shortcut icon.
This should resolve the issue.
Robot framework is not compatible with Python 3.x yet.
https://code.google.com/p/robotframework/wiki/Installation#Python_installation
Starting from Robot Framework 2.5, Python 2.5 is the minimum supported Python version. Earlier versions support also Python 2.3 and 2.4. Robot Framework is currently not compatible with Python 3.x versions.
If pip is not able to install robot framework and ride then try this,
sudo easy_install robotframework-ride

xampp-control-panel import error missing gtk on mac os x lion

I installed XAMPP 1.8.3 on Mac OS X Lion (10.8.5). I'm trying to launch xampp-control-panel in /Applications/XAMPP/xamppfiles/share/xampp-control-panel.
It asks that I run xampp-control-panel application as root. I get the following error:
Traceback (most recent call last):
File "xampp-control-panel.py", line 18, in
import gtk
ImportError: No module named gtk
I have only Apple's pre-installed Python. The command:
$ which python
outputs /usr/bin/python. I haven't installed any other Python distribution.
This question is a little old but I recently faced it as well. I found this solution,How to start xampp gui and this guide Xampp Installation in Ubuntu both of which did not work for me to run the Gui. So I put them them here in case they might help some of you.
For now, I use the following commands to start and stop XAMPP,
sudo /opt/lampp/lampp start
sudo /opt/lampp/lampp stop

Resources