While I was training a neural network with Pybrain, my computer crashed and I had to reboot it. Now Spyder, Python, IPython seem to work fine, however, when trying to open a new IPython console in Spyder, I get the following error:
Error in sitecustomize; set PYTHONVERBOSE for traceback:
TypeError: 'NoneType' object is not callable
Traceback (most recent call last):
File "C:\Users\Mi\Anaconda3\lib\site‑packages\spyderlib\widgets\externalshell\start_ipython_kernel.py", line 167, in
from IPython.kernel.zmq.kernelapp import IPKernelApp
File "C:\Users\Mi\Anaconda3\lib\site‑packages\IPython\__init__.py", line 48, in
from .core.application import Application
File "C:\Users\Mi\Anaconda3\lib\site‑packages\IPython\core\application.py", line 22, in
from IPython.config.application import Application, catch_config_error
File "C:\Users\Mi\Anaconda3\lib\site‑packages\IPython\config\__init__.py", line 6, in
from .application import *
File "C:\Users\Mi\Anaconda3\lib\site‑packages\IPython\config\application.py", line 19, in
from IPython.config.configurable import SingletonConfigurable
File "C:\Users\Mi\Anaconda3\lib\site‑packages\IPython\config\configurable.py", line 14, in
from IPython.utils.text import indent, wrap_paragraphs
File "C:\Users\Mi\Anaconda3\lib\site‑packages\IPython\utils\text.py", line 28, in
from IPython.external.path import path
File "C:\Users\Mi\Anaconda3\lib\site‑packages\IPython\external\path\__init__.py", line 2, in
from path import *
File "C:\Users\Mi\Anaconda3\lib\site‑packages\path.py", line 122, in
__version__ = pkg_resources.require('path.py')[0].version
TypeError: 'NoneType' object is not callable
The error does not seem to interfere with the execution of Python scripts however I am wondering if I accidentally messed something up. I searched the internet but found nothing that could explain this error.
I am using Python 3.4.3 64 bit with the Anaconda 2.3.0 distribution.
Either upgrade setuptools or try
pip install --upgrade --force setuptools fixed it. Either one or the other should fix the problem.
The accepted answer is correct in that it is a setup tools problem, but I couldn't use pip install --upgrade --force setuptools, that complained about not being able to find easy-install.pth
Instead I was able to upgrade setuptools using easy-install itself with:
easy_install --upgrade setuptools, hope that helps someone who was stuck like me.
I have the same problem. and setuptools did not fix my error.
finally, run
conda update path.py
fix my error. You could check this link: https://github.com/spyder-ide/spyder/issues/2679
conda update qt pyqt
conda update spyder
pip install -U spyder
This worked for me
Related
I'm getting an error upon loading tensorflow==2.4.0 in Python. I've tried uninstall and reverting to an earlier version (but still 2), but can't seem to be able to solve it. Anyone any idea? The full error is:
File "<stdin>", line 1, in <module>
File "C:\Users\CX667CJ\AppData\Roaming\Python\Python38\site-packages\tensorflow\__init__.py", line 49, in <module>
from ._api.v2 import __internal__
File "C:\Users\CX667CJ\AppData\Roaming\Python\Python38\site-packages\tensorflow\_api\v2\__internal__\__init__.py", line 11, in <module>
from . import distribute
File "C:\Users\CX667CJ\AppData\Roaming\Python\Python38\site-packages\tensorflow\_api\v2\__internal__\distribute\__init__.py", line 10, in <module>
from . import combinations
File "C:\Users\CX667CJ\AppData\Roaming\Python\Python38\site-packages\tensorflow\_api\v2\__internal__\distribute\combinations\__init__.py", line 20, in <module>
from tensorflow.python.distribute.strategy_combinations import multi_worker_mirrored_2x1_cpu
ImportError: cannot import name 'multi_worker_mirrored_2x1_cpu' from 'tensorflow.python.distribute.strategy_combinations' (C:\Users\CX667CJ\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\distribute\strategy_combinations.py)```
0
I don't know but I opened the adminstrator cmd if don't know just hover over command promp and right click and you'll see the option of open in admistrator mode click over it just uninstall using pip uninstall package_name and don't close because the package_will be cached down and when you again command pip install package_name it should work ,just because it worked for me LOL if you close it you have to download it again like ffpyplayer is of 25 mbs so why to do that
I saw similar issue today
from tensorflow.python.distribute.strategy_combinations import
multi_worker_mirrored_2x1_cpu ImportError: cannot import name
'multi_worker_mirrored_2x1_cpu' from
'tensorflow.python.distribute.strategy_combinations'
(C:\Users\sharm\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\distribute\strategy_combinations.py)
I checked out the file and could not locate 'multi_worker_mirrored_2x1_cpu'.
Looked into tensorflow repo on git. this file was present there.
So I considered reinstalling tensorflow (use virtualenv if you don't), closed my program and restarted everything. I no longer got this issue now.
Also consider,
pip3 install --upgrade tensorflow-gpu --user
version = 2.4.1
Let me know if this resolves your issue as well.
I have used matlab, but I am only 2 weeks into Python. I downloaded anaconda 3.7 and am using spyder 4.1.3. I was following a youtube tutorial on python. I was doing well until the guy access the cmd prompt (I use Windows 10) from within his IDE.
I didn't know how to so I googled it and to do so I found on pypi.org that all I had to do was run pip install spyder-terminal in the cmd prompt. I tried this but at the end it said that I had a permissions error and to try the --user option. I copied and pasted the exact error and saw on git hub, to create an environment or run python -m pip install --user [INSERT PACKAGE NAME].
I don't really understand hat an environment is so I did the second --user way. I ran python -m pip install --user spyder terminal I got an error about a location not being in the path variable, so i just copied the file location that it referenced and copied it the the path. I then went to open up spyder 4.1.3 and i got the error
Traceback (most recent call last):
File "C:\Users\Aaron\anaconda3\lib\site-packages\qtpy\__init__.py", line 204, in
from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Aaron\anaconda3\Scripts\spyder-script.py", line 10, in
sys.exit(main())
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\app\start.py", line 201, in main
from spyder.app import mainwindow
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 53, in
requirements.check_qt()
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\requirements.py", line 41, in check_qt
import qtpy
File "C:\Users\Aaron\anaconda3\lib\site-packages\qtpy\__init__.py", line 210, in
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found"
I tried opening it again and got the same error. I then tried uninstalling an dre-installing spyder in the anaconda navigator and got the same error. I tried removing the location I added to path and running "pip uninstall spyder-terminal", it said it was removed and I go the same error.
If possible, I am seeking specific steps in layman's terms, because all my knowledge thus far has come from the first 2 hours of a "cool things in python" type video.
I'm trying to send Gmail through python3. I can use the email and smptlib, but I wanted to try out pyzmail.
However, when I try to install pyzmail, I get this:
$ pip3 install pyzmail
Collecting pyzmail
Using cached https://files.pythonhosted.org/packages/23/9a/c8709821fa15cec44f825fba884284b261a06d8a0033a16f4c35470eb26a/pyzmail-1.0.3.tar.gz
Collecting distribute (from pyzmail)
Using cached https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/dist.py", line 7, in <module>
from setuptools.command.install import install
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/command/__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/setuptools/command/install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8r/50c4fq6j70q0qmhvwxvr00fw0000gn/T/pip-install-v4ervkb7/distribute/
I tested installing a different pip module but everything seemed to be in order.
I also tried easy_install but it installed for python 2.7, and not 3.
I think it might be something about my setuptools, but I don't know what needs to be done.
The pyzmail packages seems to be inactive now as the last commit and the last release were made 4 years ago. It does not seem to be updated for Python 3.6+.
There was an issue posted on the package's github page with the same error as yours: https://github.com/aspineux/pyzmail/issues/15. Someone posted a patch as a workaround but the best solution is to use pyzmail36 instead:
Tagging #cfenollosa #GheloAce in case you're still using this library
and are looking for a more maintainable way forward.
This repository unfortunately seems inactive, so I created a new
package on PyPI that includes all the fixes to make pyzmail
pip-installable on Python 3.6.
The name of the new package is pyzmail36. You can just update your
requirements.txt file to list pyzmail36 instead of pyzmail and all of
the rest of your code shouldn't need to change.
So just try with:
pip3 install pyzmail36
There are several ways to install pyzmail such as:
Try to use " pip install pyzmail36" by installing Python 3.6 first on your device.
Try to update the setup-tools by typing "pip install setuptools==20.1.1" and then install pyzmail.
Try to search for easy_install on Python 3.x, I have found several links for that.
Good luck.
I'm trying to call a function from the cluster module, like so:
import sklearn
db = sklearn.cluster.DBSCAN()
and I get the following error:
AttributeError: 'module' object has no attribute 'cluster'
Tab-completing in IPython, I seem to have access to the base, clone, externals, re, setup_module, sys, and warning modules. Nothing else, though others (including cluster) are in the sklearn directory.
Following pbu's advice below and using
from sklearn import cluster
I get:
Traceback (most recent call last):
File "test.py", line 2, in <module>
from sklearn import cluster
File "C:\Python34\lib\site-packages\sklearn\cluster\__init__.py", line 6, in <module>
from .spectral import spectral_clustering, SpectralClustering
File "C:\Python34\lib\site-packages\sklearn\cluster\spectral.py", line 13, in <module>
from ..utils import check_random_state, as_float_array
File "C:\Python34\lib\site-packages\sklearn\utils\__init__.py", line 16, in <module>
from .class_weight import compute_class_weight, compute_sample_weight
File "C:\Python34\lib\site-packages\sklearn\utils\class_weight.py", line 7, in <module>
from ..utils.fixes import in1d
File "C:\Python34\lib\site-packages\sklearn\utils\fixes.py", line 318, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr
File "C:\Python34\lib\site-packages\scipy\sparse\linalg\__init__.py", line 109, in <module>
from .isolve import *
File "C:\Python34\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in <module>
from .iterative import *
File "C:\Python34\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <module>
from . import _iterative
ImportError: DLL load failed: The specified module could not be found.
I'm using Python 3.4 on Windows, scikit-learn 0.16.1.
You probably don't use Numpy+MKL, but only Numpy.
I had the same problem and reinstalling Numpy with MKL
pip install --upgrade --force-reinstall "numpy‑1.16.3+mkl‑cp37‑cp37m‑win32.whl"
fixed it.
Note: update the file to the latest version, possibly 64bit - see the list of available Windows binaries
Problem was with scipy/numpy install. I'd been using the (normally excellent!) unofficial installers from http://www.lfd.uci.edu/~gohlke/pythonlibs/. Uninstall/re-install from there made no difference, but installing with the official installers (linked from http://www.scipy.org/install.html) did the trick.
I am using anaconda got the same error as the OP, when loading Orange, or PlotNine.
I can't recall when this start to happen.
Tracing the dependency of Anaconda3\Lib\site-packages\scipy\special\_ufuncs.cp36-win32.pyd, libifcoremd.dll and libmmd.dll are missing in DependencyWalk. Searching them in anaconda root directry, they are located in both ICC_RT and one version of MKL package.
Adding Anaconda3\pkgs\mkl-2017.0.3-0\Library\bin to PATH, seems to fix SciPy and NumPy related DLL load failure, the above package starts to work again.
I still don't know how to fix this properly. Apparently the downside is that the MKL package could be updated and versions may change so does the path. In this aspect Its equally inconvenient as adding a non-managed package.
Reinstalling ICC_RT fixed the issue for me, libmmd.dll and the related dlls are automatically copied into anaconda3/library/bin afterwards, which is automatically added into PATH by activate command. All previous numpy/scipy related cant load DLL errors are gone now.
From the error log, it shows that scipy module is the most recent module fails to import
File "C:\Python34\lib\site-packages\sklearn\utils\fixes.py", line 318, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr
File "C:\Python34\lib\site-packages\scipy\sparse\linalg\__init__.py", line 109, in <module>
from .isolve import *
File "C:\Python34\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in <module>
from .iterative import *
File "C:\Python34\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <module>
from . import _iterative
ImportError: DLL load failed: The specified module could not be found.
I have the same error that show the same log, the problem'd gone when I uninstall/install scipy:
pip uninstall scipy
pip install scipy
Place this line on top of the python file
from sklearn import cluster
That should do it :))
For me what fixed it were these commands:
pip uninstall sklearn
pip uninstall scikit-learn
pip uninstall scipy
pip install scipy
pip install scikit-learnhere
I had the same issue and solved it by installing/updating the mkl package:
conda install mkl
or
pip install mkl
Just for full information, this also downgraded the following packages:
The following packages will be UPDATED:
mkl: 2017.0.4-h6d528fc_0 defaults --> 2018.0.3-1 defaults
The following packages will be DOWNGRADED:
numpy: 1.11.3-py34_0 defaults --> 1.10.1-py34_0 defaults
pandas: 0.19.2-np111py34_1 defaults --> 0.18.1-np110py34_0 defaults
scikit-learn: 0.18.1-np111py34_1 defaults --> 0.17-np110py34_1 defaults
scipy: 0.19.1-np111py34_0 defaults --> 0.16.0-np110py34_0 defaults
I struggled trying to figure this one out; tried to download and install the (unofficial) Numpy+MKL library from the website (risky/tedious?).
Ultimately found success by:
Login to command prompt using admin rights; how to here: https://superuser.com/questions/968214/open-cmd-as-admin-with-windowsr-shortcut
Uninstall existing/tangled version of Scipy & Numpy
pip uninstall scipy
pip uninstall numpy
Fresh install Scipy & Numpy
pip install scipy
pip install numpy
Run Jupyter notebook; it worked for me.
The message ImportError: DLL load failed: The specified module could not be found
informs that there is failure to identify and source the required DLL(s) to use the scikit-learn library; a fresh install of scipy/numpy probably enables a better routing of DLL connections called from Jupyter notebook code(s).
download microsoft visual c++ distribution
link : https://www.microsoft.com/en-in/download/details.aspx?id=53840
vc_redist.x64.exe
install and run this .exe file in your computer.. the DLL import module error will not appear after this
now it will work fine enjoy :)
I am trying to get scipy running on my computer and I have been fighting for the last few hours with it. Currently, im running python 3.6 and I am on windows 10. I first tried to install it using pip which failed no matter what I did. Then I went and downloaded the wheel file and installed it manually using pip. Then I used pip to get the rest of the dependencies like the website stated pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose. It installed the rest of the packages just fine.
If I say in IDEL
import scipy
It will give me an error of
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
from scipy import special, optimize
File "C:\Users\Kevin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\scipy\__init__.py", line 116, in <module>
from scipy._lib._ccallback import LowLevelCallable
File "C:\Users\Kevin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\scipy\_lib\_ccallback.py", line 1, in <module>
from . import _ccallback_c
ImportError: cannot import name '_ccallback_c'
if I go in that file to comment out that line, it will import but it after that I get a lot more errors anytime I try and do anything.
Also, I tried installing anaconda as a dependency manager and that seemed to work fine for installing, but if I tried to used Atom or IDLE as my text editor it can't seem to find scipy when its compiling and throws and error. I am kinda at a loss and any advice or help on this would be much appreciated. Thank you in advance.