My ipython and libraries disabled after installing OS X 10.8 (Mountain Lion) - numpy

I have a problem similar to this one below:
Python pip broken after OS X 10.8 upgrade
After installing ML, I can no longer use iPython, SciPy or Matplotlib. I get this error:
Shanes-MacBook-Pro:~ $ ipython
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: ipython==0.14.dev
I have tried the following to fix it:
Using sudo ipython
Installing latest Xcode
Reinstalling SciPy superpack
When I type which python it says it is in /usr/bin/python.
Extra information:
nside /Library/python/2.7/site-packages
Inside there is the following:
DateUtils-0.5.2-py2.7.egg
README
easy-install.pth
nose-1.1.2-py2.7.egg
pika-0.9.5-py2.7.egg
pyzmq-2.2.0.1-py2.7-macosx-10.8-intel.egg
tornado-2.3-py2.7.egg
So with this ML upgrade, it removed my numpy, ipython, etc. And it does not install there anymore like it did with lion. How can I find where it installs too because it seems like it is working when I run the install_superpack shell script.

As an update, I never fixed this specific problem. However, I just downloaded the iPython, SciPy, Matplotlib etc. from Enthought. I answered someone elses question on how to do this here:
How to check whether I have IPython installed on my machine and what sequence to install these libraries?

Related

Cartopy: importing from new install results in symbol not found in flat namespace '_GEOSCoordSeq_create_r'

I'm setting up a new MacBook and testing the code that I ran on my old Macbook.
One module I need is cartopy. I have installed it using the MacOS instructions detailed here -> https://scitools.org.uk/cartopy/docs/latest/installing.html
This all installs no problem. However when I try to import cartopy I hit the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cartopy/__init__.py", line 107, in <module>
import cartopy.crs # noqa: E402 module-level imports
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cartopy/crs.py", line 27, in <module>
import cartopy.trace
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cartopy/trace.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_GEOSCoordSeq_create_r'
Tried uninstalling proj downgrading to proj7 via homebrew then uninstalling and reinstalling cartopy -> no effect
Tried uninstalling and reinstalling geos via homebrew then uninstalling and reinstalling cartopy -> no effect
Tried uninstalling and reinstalling shapely for versions earlier than 2 then uninstalling and reinstalling cartopy -> no effect
Tried installing cartopy via conda with conda install -c conda-forge cartopy -> this results in a package which I can import but which contains none of the cartopy functions and only basic functions from the "string" package.
My current versions are
cartopy 0.21.0
shapely 1.8.5.post1
geopandas 0.11.1
geos 3.11.0
proj 9.1.0
Has anyone hit this problem before and solved it?
Sorry for asking but I've been stuck on this for ages.
I managed to get cartopy installed via conda but only in the default anaconda environment. That will do but still no idea why I couldn't get it working from pip using the instructions on the cartopy site

How can I install mpmath as an external library for Blender?

I'm interested in trying out sympy with Blender (v2.76, Python 3.4.2 Console, Windows 8.1). I followed this answer from Blender SE, downloaded sympy as a ZIP from Githib, and moved the sympy folder to C:\Program Files\Blender Foundation\Blender\2.76\python\lib\site-packages. However, when I opened Blender and tried to import sympy in the Python Console, I got the following error:
>>> import sympy
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.76\python\lib\site-packages\sympy\__init__.py", line 20, in <module>
raise ImportError("SymPy now depends on mpmath as an external library. "
ImportError: SymPy now depends on mpmath as an external library. See http://docs.sympy.org/latest/install.html#mpmath for more information.
I don't know how to install an external library. I tried going to the link mentioned in the ImportError, and I saw pip install mpmath. I tried it in cmd, but got this:
>pip install mpmath
Requirement already satisfied (use --upgrade to upgrade): mpmath in c:\anaconda3
\lib\site-packages
I did install Anaconda a while ago, so I guess it makes sense to have this output. How can I install mpmath as an external library for Blender so I can import sympy in it?
You want to install mpmath into blenders python folder, the same as you have done for sympy.
Your example of running pip was done in a system installed python that is setup to find the mpmath that you have installed in c:\anaconda3\lib\site-packages
Another option is to use the existing install of mpmath and sympy by adding your existing path to sys.path or adding it to the PYTHONPATH environment variable before you start blender.

ImportError: No module named core.framework.graph_pb2

When I follow the Installation for linux from tensorflow offical site, everything is fine until the last step: Train your first TensorFlow neural net model.
When I execute the command, python tensorflow/models/image/mnist/convolutional.py, An ImportError promps.
Traceback (most recent call last):
File "tensorflow/models/image/mnist/convolutional.py", line 13, in <module>
import tensorflow.python.platform
File "/home/guo/haplox/Github/tensorflow/tensorflow/__init__.py", line 4, in <module>
from tensorflow.python import *
File "/home/guo/haplox/Github/tensorflow/tensorflow/python/__init__.py", line 13, in <module>
from tensorflow.core.framework.graph_pb2 import *
ImportError: No module named core.framework.graph_pb2
My OS is 14.04.1-Ubuntu.
I have met the exactly same issue. once your have installed the tensorflow successfully, it's not about the library dependency anymore.
if your executed the convolution.py 100% accurately as manual and get the exception like below
ImportError: No module named core.framework.graph_b2
this means you are executing the python script exactly under the cloned project root directory,let's say the root named "src".
src$python tensorflow/models/image/mnist/convolutional.py
please try to execute the script in the parent directory of the cloned root directory. for example, if your just clone the tensorflow under src dir, goto its parent dir like xxx and do it again.
xxx$python src/tensorflow/models/image/mnist/convolutional.py
bingo, it works like a charm!
I had the same issue and the solution was to uninstalled protocol buffer v2.6.
TensorFlow requires protocol buffer v3.0, which should come with your TensorFlow installation/source. Hope this helps.
Most probably you have either outdated version of:
python's six module. Install the newest one (pip install six) or upgrade your old one (pip install --upgrade six)
protobuf
I solved it by using virtualenv, but there are many other factors which may cause the same error.
More solutions are at Github issues #81, #61,
#51.
For me, the solution was to run with python3 instead python

faulty install of Matplotlib

Windows7 with python 3.4 32bit.
Downloaded and ran install according to this related question.
However I have a different error, so I posted a new question.
I removed the faulty install and tried the installer from the sourceforge link off matplotlib.org. Both finish claiming to be successful, though testing results in an error (both resulting in the same error)
from matplotlib import *
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
from matplotlib import *
File "C:\Python34\lib\site-packages\matplotlib\__init__.py", line 105, in <module>
import six
ImportError: No module named 'six'
Actually you need to install six. As given in Python Error: "ImportError: No module named six"
Better you can install pip and install all libraries using that.

Numpy Install Mac Osx Python

I am using Python for my Linear Algebra course for programming. For the tools we need, I am trying to install NumPy. I used this website to guide me through the installation process.
I started from the links on SciPy's OS X page and eventually arrived at the SourceForge download site.
From there, I chose the Mac OS X installer numpy-1.6.1-py2.7-python.org-macosx10.3.dmg.
When I went to Idle and typed in
>>> import numpy as np
This is the error I received:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
import add_newdocs
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py", line 4, in <module>
from type_check import *
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py", line 5, in <module>
import multiarray
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper
I also tried it from the terminal and got the same error. I have a virtual environment installed - virtual env wrapper. I called the environment in the terminal by:
source my_new_env/bin/activate
And then I tried to import numpy in the terminal that way, but then I got the error:
(my_new_env) $ sudo python -c 'import numpy; numpy.test()'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numpy
I am not sure if I installed NumPy incorrectly or if my virtual environment is conflicting with Nose. If anyone has suggestions let me know!
i would skip the MacOS package install and use the 'pip install' instructions, since you're already familiar with virtualenvs. use these instructions instead: http://www.scipy.org/install.html#installing-via-pip
it's easier to work with a virtualenv and pip, which will ensure post-install that your virtualenv will have access to the modules you've installed. it takes more work to do that with an external package (or .dmg) that you've downloaded. not impossible, just more work. HTH.
Try these commands:
brew update, brew doctor
, because, in my case, I didn't even have to install numpy separately. Yet I could import numpy easily. Meanwhile you can try downloading the numpy package from this website.