I've tried to install wxPython on my mac with brew, using the command suggested at How do I install wxPython on Mac OS X? by rajmohanloganathan
brew install --python wxmac --devel
That seems to work, but when I try setting up the symlink, I don't find a folder corresponding to /usr/local/Cellar/wxmac/2.9.4.0/lib/python2.7/site-packages/wx. In my /usr/local/Cellar/wxmac/3.02/lib/, there is no python2.7 directory. The closest I come is /usr/local/Cellar/wxmac/3.02/lib/wx, and linking to that doesn't work.
When I brew doctor, I get a warning that python is installed in /Library and that this may cause problems with other installations. Is that the root of my problem? How do I go about fixing matters?
The advice I looked at is outdated.
brew install wxpython
is all you need.
Related
I've just upgraded to macOS Catalina, I've used brew install dpkg, and homebrew decided it was time to run brew cleanup.
After running it, I've not been able to run pip3 anymore.
Tried running brew doctor and brew reinstall python3, but none helped.
Running pip3 outputs this:
[1] 26346 abort pip3
I meet the same problem, and i found the solution for this problem, you can check this comment in github, it's works for me.
I found something that may be helpful!
The asn1crypto python package imports libcrypto. I removed this package from my site packages /usr/local/lib/python3.7/site-packages and now pip3 works
It turns out brew uninstall python3 does not really uninstalls it, had to remove /usr/local/lib/python3 to really remove the installation, and then reinstall python using brew install python3
The solution to libcrypto complaining about using unversioned dylib from r.xuan that Marcos linked to seems like the best workaround for now. The steps in a bit more fool-proof fashion can be found in this SO answer.
I am trying to install Mayavi fro Python on Mac OS X Mavericks using Homebrew and pip. I am stuck because of an unclear error related to VTK: I have installed VTK 5 with Homebrew using
brew reinstall --python --qt vtk5
and tried to install Mayavi with
pip install mayavi
but I just get en error output which ends with
ImportError: No module named vtkCommonCorePython
I thought about an issue with my PYTHONPATH variable, but I cannot find where vtkCommonCorePython is located. My PYTHONPATH is
/Users/ft14968/Scripts:/usr/local/lib/python2.7/site-packages:usr/local/opt/vtk5/lib/python2.7/site-packages
Is there a way to circumvent this issue, or to install a working python VTK binding with Homebrew?
brew reinstall --python --qt vtk5
Check brew info for exactly what formula options are available. For vtk5, the options you're looking for are --with-python --with-qt. Anything unrecognized is ignored.
Here are the details of my python install:
OS X 10.9
homebrew used to install pyenv (https://github.com/yyuu/pyenv)
python was installed via pyenv install 2.7.6
custom virtualenv just for this project
Given the above python install, how would someone set up libxml2?
So far, I've tried brew install libxml2, hacking the recipe to have --with-python. That seems to compile, but then python starts having SegFaults when I try to use libxml2.
Thanks in advance!
It may possibly be related to packages being compiled against old libxml2. You can check libxml2 origin with gdb, run gdb python and execute command that lead to SegFault.
One option why it is happening is that brew installed libxml2 to local folder, say /usr/local, and your packages are compiled against libraries shipped with OS (usually old and buggy on OSX, not sure for Mavericks) from /usr/lib are being used.
Found the solution.
brew install libxml2 --with-python
Some files were installed into /usr/local/lib/python2.7/site-packages/libxml2*. I copied them to my virtualenv's site-packages and voila things worked!
Symlinking might be something better to try.
I am trying to install the Scipy python stack, but having issues.
I have a new mac os with mavericks (10.9).
I have installed homebrew and am using brew to manage installations.
I used
% brew install python
then (I verified pip is from my homebrew installation)
% pip install numpy [this works]
% pip install scipy [this works]
% pip install matplotlib OR pip install http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz
Both fail with the same error. After checking the backend, I get
Fatal Python error: PyThreadState_Get: no current thread
The error message from mac os X (the pop up error window) shows errors very similar to those in the previous thread
Homebrew + Python on mac os x 10.8: Fatal Python error: PyThreadState_Get: no current thread importing mapnik
It seems I need to fix the python bindings, as some of them linked against the /System/Library python that ships with the mac. What is not clear to me from the above post is
which of the Binary Images need to be "re-linked"? all of them? some seem quite general an not related to matplotlib
how do I actually use install_name_tool to fix the link? As I mentioned, some seem quite general - do I really want to change the path? Do I cp the dylib from old to new?
I have also tried
brew uninstall python
and re-brewing, all to get the same error. I am trying not to use EPD because EPD installs its own libxml2 and others, which I need for other software I will install, and this has caused me problems on an old machine. I am open to considering a virtualenv, but was hoping to learn to just fix my current problem if possible.
Thanks,
Andre
PS, when pip install matplotlib`, the following warning appears, which seems odd because matplotlib is such a staple piece of software
You are installing an externally hosted file. Future versions of pip will default to disallowing externally hosted files.
You are installing a potentially insecure and unverifiable file. Future versions of pip will default to disallowing insecure files.
This is an issue in pygtk. You can test it with brew (it should throw the same error):
brew test pygtk
I ran into the same problem, and got past that error with the following steps from https://github.com/mxcl/homebrew/issues/13654
brew rm py2cairo
brew install py2cairo
You can test that pygtk is working using brew test pygtk again.
I'm still having other problems getting pip install matplotlib to work, so you may also run into more problems, but that should get you past that particular issue.
I had the same problem, and after some experimentation it seems that installing under Python 3 works more reliably. i.e. this installed without error:
pip3 install matplotlib
I then had to re-install everything else using pip3, and make sure I was running under python3 at execution time.
brew install freetype
it works on mac os sierra!
I use Mac OS X Lion and Python 2.7. I am new to python. Can anyone tell me how to import AppKit and PyObjC to Python. But i get the errors when trying to import Import Error: No module named AppKit or 'Import Error: No module named PyObjC.
Trying easy_install does not help either.
What can i do to import these 2 modules?
If not already installed, install pip by running:
sudo easy_install pip
Then run:
## install for all users
sudo pip install pyobjc
or
## install for current user only
pip install pyobjc --user
NOTE: the general recommendation is to avoid using the system python, and use instead a user-maintained version, for example installed via brew install python3, macports, conda or whatever you already use for third party dependencies.
If you're on Mac it could be you're using the incorrect pip version, try sudo pip3 install -U pyobjc that solved it for me.
This a good guide on how to install PyObjc: http://ioanna.me/2009/09/installing-pyobjc-xcode-templates-in-snow-leopard/
When I was trying to install PyObjc I found it quite hard, but after a while, (and lots of google searches) I got it working.
Edit
I've found a more modern guide on how to do this. Download the templates and put them into your ~/Library/Developer/Xcode/Templates/ directory, and everything should work correctly.
If you are using PyCharm, you should install PyObjC package manually within it because of venv I guess. This was the only working solution for me.
In my case none of them worked. I was using Anaconda in my mac, later I discovered that the main issue with the Anaconda. Then I installed PyObjC with it's all supporting libraries inside Anaconda in a specific Environment.
I run the command line by clicking the Environment play icon and run my script.
It worked without any issues :)