I want to load EXR images in a Python script. Thus I imported it with
import OpenEXR
but unfortunately I am getting the following error when I start my script with
ipython testscript.py
Error Message
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
PATH_TO_SCRIPT/testscript.py in <module>()
8 import numpy as np
9 # import matplotlib.pyplot as plt
---> 10 import OpenEXR
11
12 # import dts_input
ImportError: PATH_TO_SCRIPT/OpenEXR.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZTIN7Imf_2_27OStreamE
I have installed OpenEXR with Arch Linux's package manager and the binding module for python locally with
pip install --target ./ openexr
and a file called OpenEXR.cpython-37m-x86_64-linux-gnu.so has been installed in the script folder.
I have no idea how to solve the linking problem since it seams to be a linking error relating to OpenEXR's own imf library.
Related
I get an error when I import the emoji into my Jupyter notebook.
This is the error I'm getting.
ModuleNotFoundError Traceback (most recent call last)
/var/folders/8v/gry0pxmn7tq64rhkjv504zr00000gn/T/ipykernel_12578/2329533640.py in <module>
2 import pandas as pd
3 import numpy as np
----> 4 import emoji
5 from collections import Counter
6 import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'emoji'
I am using MacOs. How do I solve this?
Did you install the library?
For the installation process via pip:
pip install emoji --upgrade
or via git:
git clone https://github.com/carpedm20/emoji.git
cd emoji
python setup.py install
That being done, you can import emoji into your code.
For further information you can read the installation process on the documentation here.
I am getting the following error in Jupyter Note Book when running the code below in Python.
import talib
I get the following
ImportError Traceback (most recent call last)
<ipython-input-20-29b7d6c547d4> in <module>()
4 import numpy as np
5 import tensorflow
----> 6 import talib
7 import _talib
8 import alpaca_trade_api as tradeapi
ImportError: No module named 'talib'
I am running Anaconda on a MAC
I have looked at all of the existing questions on this and found nothing.
When I use the PIP freeze command I see the following library and version
TA-Lib==0.4.17
The folder talib exists in the following path
anaconda3/lib/python3.7/site-packages
I installed mpl_toolkits.basemap yet it is still not working. In ipython I am trying:
In [1]: from mpl_toolkits.basemap import Basemap
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-d9467465a3b6> in <module>()
----> 1 from mpl_toolkits.basemap import Basemap
/usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/__init__.py in <module>()
37 import numpy as np
38 import numpy.ma as ma
---> 39 import _geoslib
40 import functools
41
ImportError: libgeos-3.6.2.so: cannot open shared object file: No such file or directory
Still not working. Help.
I got the same error when trying to install PostGIS. Installing the following fixed the error for me
sudo apt-get install binutils libproj-dev gdal-bin
Once I had a similar error. I fixed it finding the location of the library. In my case the location was different that where all my libs where, so I moved it to the correct folder and it worked.
I am trying to run Google Research's DeepDream code on a mac running OSx 10.9.5.
There are a few dependencies that I had to install. I am using the Anaconda distribution of python and I made sure that I have all the packages required.
The hardest thing was to install Caffe. I have ATLAS installed using fink. Then I have compiled caffe and pycaffe. When I ran 'make runtest' all tests passed. I also ran 'make distribute'.
When I run the notebook released from Google, I get the following error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-8200bcb1df23> in <module>()
7 from google.protobuf import text_format
8
----> 9 import caffe
10
11 def showarray(a, fmt='jpeg'):
ImportError: No module named caffe
How can this be? What can I try to do to fix it?
My platform:
Ubuntu 13.04, Python 2.7.4.
Installing matplotlib failed, ImportError: No module named pyplot.
I have tried many ways such as
$ sudo apt-get install python-matplotlib
and easy install, install from source..., I'm folllowing http://matplotlib.org/faq/installing_faq.html
But none of them works, This ImportError always happen, Anyone can help?
EDIT The trace back:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-82be63b7783c> in <module>()
----> 1 import matplotlib
/home/wuhuijia/matplotlib.py in <module>()
1 import numpy as np
----> 2 import matplotlib.pyplot as plt
3 import scipy.optimize as so
4
5 def find_confidence_interval(x, pdf, confidence_level):
ImportError: No module named pyplot
Your script is named matplotlib.py. Python will first look locally when importing modules, that is, on the directory itself. Thus, Python imports your script (and not the installed matplotlib) when you execute import matplotlib.pyplot, and since your script has no submodule pyplot, it fails.
Rename your script to something else (e.g., testmpl.py) and you should be fine.