I am a paid user and I have installed canopy on a red hat server and got the virtual environment configured. In the virtual env, python is the one contained in the environment:
(User) $ which python
~/Enthought/Canopy_64bit/User/bin/python
But when I cannot import "numpy" from python:
(User) $ python
Enthought Canopy Python 2.7.3 | 64-bit | (default, Mar 25 2013, 15:55:17)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/canopy/appdata/canopy-1.0.0.1160.rh5-x86_64/lib/python2.7/site-packages/numpy/__init__.py", line 148, in <module>
import add_newdocs
File "/usr/lib/canopy/appdata/canopy-1.0.0.1160.rh5-x86_64/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/canopy/appdata/canopy-1.0.0.1160.rh5-x86_64/lib/python2.7/site-packages/numpy/lib/__init__.py", line 13, in <module>
from polynomial import *
File "/usr/lib/canopy/appdata/canopy-1.0.0.1160.rh5-x86_64/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 17, in <module>
from numpy.linalg import eigvals, lstsq
File "/usr/lib/canopy/appdata/canopy-1.0.0.1160.rh5-x86_64/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 48, in <module>
from linalg import *
File "/usr/lib/canopy/appdata/canopy-1.0.0.1160.rh5-x86_64/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 23, in <module>
from numpy.linalg import lapack_lite
**ImportError: libmkl_intel_lp64.so: cannot open shared object file: No such file or directory**
I tried to update numpy with enpkg, but the above error still shows up when importing numpy.
(User) $ enpkg numpy
prefix: /home/wchen06/canopy_virtual
MKL-10.3-1.egg [fetching]
74.60 MB [.................................................................]
numpy-1.6.1-5.egg [fetching]
3.33 MB [.................................................................]
MKL-10.3-1.egg [installing]
248.04 MB [.................................................................]
numpy-1.6.1-5.egg [installing]
11.20 MB [.................................................................]
Please help.
Sorry for the late reply! This is due to a bug in Canopy 1.0.0 (beta) for Linux. For a workaround, please see https://support.enthought.com/entries/21656595-ImportError-libmkl-intel-lp64-so-cannot-open-shared-object-file
Related
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/suman/.local/lib/python3.6/site-packages/pandas/__init__.py", line 180, in <module>
import pandas.testing
File "/home/suman/.local/lib/python3.6/site-packages/pandas/testing.py", line 5, in <module>
from pandas._testing import (
File "pandas/src/testing.pyx", line 4, in init pandas._testing (pandas/src/testing.c:4068)
File "/home/suman/.local/lib/python3.6/site-packages/pandas/types/missing.py", line 5, in <module>
from pandas import lib
File "pandas/lib.pyx", line 1, in init pandas.lib (pandas/lib.c:87552)
File "pandas/tslib.pyx", line 67, in init pandas.tslib (pandas/tslib.c:109851)
ImportError: cannot import name parse_date
Make sure that you have installed pandas in the proper directiry:
pip install pandas
If you have already done so, it would be worth upgrading pandas:
pip install pandas --upgrade
Hi I got the same error today when I developed a pyqt project. I found there are two "pandas" when I uninstalled one then tried to install again. What I have done was uninstalling both two "pandas", then install the latest version, then it works. Although I solved this on Windows, but hope it is helpful to you.
After following the Ubuntu/Debian installation instructions for the Nest simulator I can only import the nest module in python2.x, not python3.x
$ python3
Python 3.6.8 (default, Aug 20 2019, 17:12:48)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nest/lib/python2.7/site-packages/nest/__init__.py", line 26, in <module>
from . import ll_api # noqa
File "/nest/lib/python2.7/site-packages/nest/ll_api.py", line 72, in <module>
from . import pynestkernel as kernel # noqa
ImportError: dynamic module does not define module export function (PyInit_pynestkernel)
The default install compiles with the default Python version which is still 2 in Ubuntu.
To use Python 3, run:
cmake -Dwith-python=3 -DCMAKE_INSTALL_PREFIX:PATH=</install/path> </path/to/NEST/src>
Mentioned here in the doc.
NB: don't forget to clear the build folder to avoid issues
I'm trying to import bigquery from google.cloud, but it's failing because there's a missing dependency. I'm using Python 3.7.1.
Here is the error I'm getting:
Python 3.7.1 (default, Dec 14 2018, 13:28:58)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.cloud import bigquery
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/anaconda3/lib/python3.7/site-packages/google/cloud/bigquery/__init__.py", line 35, in <module>
from google.cloud.bigquery.client import Client
File "/anaconda3/lib/python3.7/site-packages/google/cloud/bigquery/client.py", line 53, in <module>
from google.cloud.bigquery.dataset import Dataset
File "/anaconda3/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line 24, in <module>
from google.cloud.bigquery.model import ModelReference
File "/anaconda3/lib/python3.7/site-packages/google/cloud/bigquery/model.py", line 27, in <module>
from google.cloud.bigquery_v2 import types
File "/anaconda3/lib/python3.7/site-packages/google/cloud/bigquery_v2/__init__.py", line 23, in <module>
from google.cloud.bigquery_v2 import types
File "/anaconda3/lib/python3.7/site-packages/google/cloud/bigquery_v2/types.py", line 23, in <module>
from google.cloud.bigquery_v2.proto import model_pb2
File "/anaconda3/lib/python3.7/site-packages/google/cloud/bigquery_v2/proto/model_pb2.py", line 28, in <module>
from google.api import client_pb2 as google_dot_api_dot_client__pb2
ImportError: cannot import name 'client_pb2' from 'google.api' (/anaconda3/lib/python3.7/site-packages/google/api/__init__.py)
I've tried upgrading, and uninstalling and reinstalling the "google-cloud-bigquery" and "google-api-python-client" libraries, but this error continues to occur.
I'm not sure how to resolve this error or how to debug it further. I thought it may have been my version of the package, but I haven't been able to replicate this issue on other computers. Is it possible this is occurring because of my version of Python, or because it's installed through Anaconda?
Edit: https://github.com/googleapis/google-cloud-python/issues/8674
Solution is there - upgrade googleapis-common-protos
As you mentioned in your post the solution is to update the module googleapis-common-protos using:
pip install --upgrade googleapis-common-protos
Common Protos are common dependencies throughout the Google API ecosystem, and which are made available for use as dependencies elsewhere as BigQuery.
I recently installed shap, which requires pillow>=4.3.0 as:
$ pip3 install shap
Installing collected packages: shap, pillow
Successfully installed pillow-6.0.0 shap-0.29.2
Running my script that uses shap, I got:
Traceback (most recent call last):
File "Runner.py", line 132, in <module>
import shap
File "/usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/shap/__init__.py", line 11, in <module>
from .plots.summary import summary_plot
File "/usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/shap/plots/summary.py", line 15, in <module>
from . import colors
File "/usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/shap/plots/colors.py", line 7, in <module>
import skimage.color
File "/Users/bravina/Library/Python/3.6/lib/python/site-packages/skimage/__init__.py", line 135, in <module>
from .data import data_dir
File "/Users/bravina/Library/Python/3.6/lib/python/site-packages/skimage/data/__init__.py", line 13, in <module>
from ..io import imread, use_plugin
File "/Users/bravina/Library/Python/3.6/lib/python/site-packages/skimage/io/__init__.py", line 7, in <module>
from .manage_plugins import *
File "/Users/bravina/Library/Python/3.6/lib/python/site-packages/skimage/io/manage_plugins.py", line 24, in <module>
from .collection import imread_collection_wrapper
File "/Users/bravina/Library/Python/3.6/lib/python/site-packages/skimage/io/collection.py", line 10, in <module>
from PIL import Image
File "/usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/Image.py", line 93, in <module>
from . import _imaging as core
ImportError: dlopen(/usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so, 2): Library not loaded: #loader_path/.dylibs/libtiff.5.dylib
Referenced from: /usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so
Reason: Incompatible library version: _imaging.cpython-36m-darwin.so requires version 10.0.0 or later, but libtiff.5.dylib provides version 8.0.0
Same thing if I try it directly in python3:
Python 3.6.4 (default, Jan 4 2018, 14:56:03)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/Image.py", line 93, in <module>
from . import _imaging as core
ImportError: dlopen(/usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so, 2): Library not loaded: #loader_path/.dylibs/libtiff.5.dylib
Referenced from: /usr/local/Cellar/python3/3.6.4_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so
Reason: Incompatible library version: _imaging.cpython-36m-darwin.so requires version 10.0.0 or later, but libtiff.5.dylib provides version 8.0.0
Any tips as how to fix this?
Well, none of the answers suggested in this related post worked for me, so I ended up completely cleaning and reinstalling python3. From there, installing the necessary packages in a virtualenv as cleanly as possible seemed to resolve the issue...
The aiohttp module was installed successfully
But can not be imported as below info
[root#ceph_admin ~]# python3
Python 3.6.5 (default, Jul 1 2018, 23:52:30)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aiohttp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/aiohttp/__init__.py", line 6, in <module>
from .client import * # noqa
File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 17, in <module>
from . import client_exceptions, client_reqrep
File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 17, in <module>
from . import hdrs, helpers, http, multipart, payload
File "/usr/local/lib/python3.6/site-packages/aiohttp/helpers.py", line 40, in <module>
import idna_ssl
File "/usr/local/lib/python3.6/site-packages/idna_ssl.py", line 1, in <module>
import ssl
File "/usr/local/lib/python3.6/ssl.py", line 101, in <module>
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
The error above is
ModuleNotFoundError: No module named '_ssl'
So the real problem is my python3 can not import the module _ssl
My python 3.5 was installed from source code. Below are the correct ways to make python 3.5 have _ssl.
1. install openssl-devel by yum(My OS is CentOS)
2. compile your python source code with command (./configure && make && make install)