I tried to install the openpyxl module, but during the installation it showed some errors with JDcall. When I then try to import it, I get this error:
Traceback (most recent call last):
File "C:\Andrzej\workspace\sandbox\sandbox.py", line 7, in <module>
import openpyxl
File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\__init__.py", line 29, in <module>
from openpyxl.workbook import Workbook
File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\workbook\__init__.py", line 25, in <module>
from .workbook import *
File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\workbook\workbook.py", line 35, in <module>
from openpyxl.worksheet import Worksheet
File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\worksheet\__init__.py", line 25, in <module>
from .worksheet import *
File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\worksheet\worksheet.py", line 35, in <module>
import openpyxl.cell
File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\cell\__init__.py", line 25, in <module>
from .cell import *
File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\cell\cell.py", line 47, in <module>
from openpyxl.date_time import (
File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\date_time.py", line 34, in <module>
from jdcal import (
ImportError: No module named 'jdcal'
I get this same problem for Python 3.4 and 3.3, how can I solve it?
You should install jdcal separately. After this, install Openpyxl. I faced the same issue - after doing this, it got resolved
After I downloaded the jdcal-x.x.x.tar.gz from https://pypi.org/project/jdcal/#files and extracted it in \path\to\pythonxx\Lib\site-packages\ I had to copy the jdcal.py file from \path\to\pythonxx\Lib\site-packages\jdcal-1.4.1\ to \path\to\pythonxx\Lib\site-packages\ in order to work.
jdcal is a library required by openpyxl but should be installed automatically. How are you installing openpyxl?
I managed to get openpyxl to work by uninstalling openpyxl, jdcall and et-xmlfile, then reinstalling all three, then upgrading all three.
Not sure why it works, and the error messages are still there, but I was able to successfully import openpyxl and create a workbook.
Related
I get an error when importing sklearn in python 3.9.
I am using I.D.L.E. in Windows.
Installed it using cmd command: pip install -U scikit-learn as given in https://scikit-learn.org/stable/install.html
The received error message is:
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
import sklearn
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\__init__.py", line 82, in <module>
from .base import clone
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\base.py", line 17, in <module>
from .utils import _IS_32BIT
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\utils\__init__.py", line 29, in <module>
from .fixes import parse_version, threadpool_info
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\utils\fixes.py", line 19, in <module>
import scipy.stats
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\scipy\stats\__init__.py", line 453, in <module>
from ._stats_py import *
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\scipy\stats\_stats_py.py", line 38, in <module>
from scipy.spatial.distance import cdist
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\scipy\spatial\__init__.py", line 104, in <module>
from ._qhull import *
ImportError: DLL load failed while importing _qhull: The specified module could not be found.
Please help.
Since the required file _qhull.yp39-win_amd64.pyd is there, it must be a problem with the dependencies this DLL file has and can't find on your computer.
Use a dependency walker like this one to find out what is missing on your system and see that you get those missing pieces installed.
Quite likely you are missing some of the Microsoft Redistributable Visual Studio Files.
Apparently my scipy got corrupted somehow. Uninstalling and re-installing it fixed the problem. Thanks everyone who took their time and effort to help though.
I am an amateur programmer. I am trying to use:
import thinkdsp as dsp
import thinkplot as plt
I have installed the pip install thinkx module but I keep getting that error and I don't understand why. I will leave what the console shows down below:
Traceback (most recent call last):
File "Karaokemaker1.py", line 1, in <module>
import thinkdsp as dsp
File "C:\Users\keigo\anaconda3\lib\site-packages\thinkdsp.py", line 17, in <module>
import scipy.stats
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\stats\__init__.py", line 384, in <module>
from .stats import *
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\stats\stats.py", line 185, in <module>
from . import distributions
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\stats\distributions.py", line 10, in <module>
from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py", line 25, in <module>
from scipy import optimize
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\optimize\__init__.py", line 390, in <module>
from ._minimize import *
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\optimize\_minimize.py", line 30, in <module>
from ._trustregion_constr import _minimize_trustregion_constr
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\optimize\_trustregion_constr\__init__.py", line 4, in <module>
from .minimize_trustregion_constr import _minimize_trustregion_constr
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\optimize\_trustregion_constr\minimize_trustregion_constr.py", line 4, in <module>
from scipy.sparse.linalg import LinearOperator
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.py", line 116, in <module>
from .eigen import *
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\__init__.py", line 11, in <module>
from .arpack import *
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\__init__.py", line 22, in <module>
from .arpack import *
File "C:\Users\keigo\anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 45, in <module>
from . import _arpack
ImportError: DLL load failed: The specified procedure could not be found.
I assumed the issue was with the scipy because all the following errors come from that module. I checked and I have everything installed properly for the scipy module.
Please help! Thank you!
Run any command prompt you are using as administrator and then run pip install lib_name --force-reinstall
Try using these two commands they will help you:
conda remove --force scipy
And:
pip install scipy
Hello I had the same issue than you. Depend on wich version of python you use you should choose a version thinkx. I recommend you to go on the website of thinkx and check out for past udapte. In my case that was with matplotlib 3.3.1 for python 3.7. I went in git bash and used
pip install matplotlib==3.0.1
and everything worked. I had the same issue with seaborn and it worked.
I'm trying to use mayavi in python to visualize a pointcloud, and cannot resolve this error. I'm sure it is an easy pip install, but I am unsure of the command. Any help is much appreciated! Thanks!
BTW, I am running Ubuntu 18.04 and have tried installing scipy as mentioned here: Python import error "getfullargspec". I have also ran pip install traitsui. Additionally, I have rebooted my system.
Update:
After further digging, it appears that it may be an issue with Python versions. I was able to get it to run with Python3, but not Python 2.7 (I need it to work with python 2). I have also tried modifying the code within handler.py to getargspec instead of getfullargspec. I was given an error about trait_factory by doing this
Here is the entire printout:
Traceback (most recent call last):
File "mayavi_test.py", line 3, in <module>
from mayavi import mlab
File "/home/user/.local/lib/python2.7/site-packages/mayavi/mlab.py", line 16, in <module>
from mayavi.tools.camera import view, roll, yaw, pitch, move
File "/home/user/.local/lib/python2.7/site-packages/mayavi/tools/camera.py", line 24, in <module>
from .engine_manager import get_engine
File "/home/user/.local/lib/python2.7/site-packages/mayavi/tools/engine_manager.py", line 12, in <module>
from mayavi.preferences.api import preference_manager
File "/home/user/.local/lib/python2.7/site-packages/mayavi/preferences/api.py", line 4, in <module>
from .preference_manager import preference_manager
File "/home/user/.local/lib/python2.7/site-packages/mayavi/preferences/preference_manager.py", line 29, in <module>
from traitsui.api import View, Group, Item
File "/home/user/.local/lib/python2.7/site-packages/traitsui/api.py", line 37, in <module>
from .editors.api import (
File "/home/user/.local/lib/python2.7/site-packages/traitsui/editors/__init__.py", line 26, in <module>
from .api import (
File "/home/user/.local/lib/python2.7/site-packages/traitsui/editors/api.py", line 6, in <module>
from .array_editor import ArrayEditor
File "/home/user/.local/lib/python2.7/site-packages/traitsui/editors/array_editor.py", line 34, in <module>
from ..view import View
File "/home/user/.local/lib/python2.7/site-packages/traitsui/view.py", line 41, in <module>
from .ui import UI
File "/home/user/.local/lib/python2.7/site-packages/traitsui/ui.py", line 51, in <module>
from .handler import Handler, ViewHandler
File "/home/user/.local/lib/python2.7/site-packages/traitsui/handler.py", line 27, in <module>
from inspect import getfullargspec
ImportError: cannot import name getfullargspec
The solution for this problem was to use older packages. Not all of the dependencies such as traitsui are compatible with Python 2.7. Even though an older version of mayavi was installed, the dependencies that are installed automatically are not compatible (they only support Python 3).
Here are the versions that work well together for me:
mayavi==4.6.2
traitsui==6.1.3
traits==5.2.0
numpy==1.17.4
pyface==6.1.2
To install a specific version, just run sudo pip install packageName==#.#.#
Tried anaconda today , it seems fine but when I tried to launch Spyder each time I get this error: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\spyder-script.py", line 6, in <module>
from spyder.app.start import main
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\start.py", line 23, in <module>
from spyder.utils.external import lockfile
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\lockfile.py", line 22, in <module>
import psutil
File "C:\Users\Jaker\AppData\Roaming\Python\Python36\site-packages\psutil\__init__.py", line 126, in <module>
from . import _pswindows as _psplatform
File "C:\Users\Jaker\AppData\Roaming\Python\Python36\site-packages\psutil\_pswindows.py", line 16, in <module>
from . import _psutil_windows as cext
ImportError: cannot import name '_psutil_windows'
Any help regarding this ? Also how do I get python 3.6.3 in anaconda..?
The problem is you have two Python versions installed in your system: one in C:\ProgramData\Anaconda3\ and the other in C:\Users\Jaker\AppData\Roaming\Python\Python36.
Please uninstall one of them and the problem will be solved.
Here is my error:
Traceback (most recent call last):
File "./convert.py", line 6, in <module>
import openpyxl # from https://pythonhosted.org/openpyxl/ or PyPI (e.g. via pip)
ImportError: No module named openpyxl
i have installed the python package openpyxl but this error still appear
Im using linux python version 2.6.6
any help please
i got this new error when i ran the python2.7 script.py:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
File "/usr/local/lib/python2.7/site-packages/pip/__init__.py", line 13, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 15, in <module>
import zipfile
File "/usr/local/lib/python2.7/zipfile.py", line 6, in <module>
import io
File "/usr/local/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: /usr/local/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException
openpyxl module has 2 dependent modules : 1. jdcal 2. et_xmlfile
I was able to install openpyxl module and this is what I did :
1.Downloaded the openpyxl,jdcal and et_xmlfile from https://pypi.python.org/pypi and saved jdcal-1.0.tar.gz, et_xmlfile-1.0.0.tar.gz,openpyxl-2.3.0-b2.tar.gz in a local folder in my system.
2.Then I ran the commands in the following order :
pip install jdcal-1.0.tar.gz
pip install et_xmlfile-1.0.0.tar.gz
pip install openpyxl-2.3.0-b2.tar.gz
openpyxl got successfully after this. Please check whether this helps.