My issue is about the import of scipy
Reproducing code example:
import scipy
Error message:
Traceback (most recent call last):
File "D:/Projects/gait/tests/__init__.py", line 2, in <module>
import scipy
File "C:\Users\Leynier\AppData\Local\Programs\Python\Python37-32\lib\site-packages\scipy\__init__.py", line 110, in <module>
from scipy._lib._version import NumpyVersion as _NumpyVersion
File "C:\Users\Leynier\AppData\Local\Programs\Python\Python37-32\lib\site-packages\scipy\_lib\__init__.py", line 14, in <module>
from scipy._lib._testutils import PytestTester
ValueError: source code string cannot contain null bytes
Process finished with exit code 1
Scipy/Numpy/Python version information:
Scipy version: 1.3.0
Numpy version: 1.16.4
Python version: 3.7.3
OS: Windows 10
Related
I am getting error when I running yolo.trt file how can I fix that.
Traceback (most recent call last):
File "yolo_trt.py", line 8, in
from utils.yolo_with_plugins import TrtYOLO
File "/home/oret/tensorrt_demos/utils/yolo_with_plugins.py", line 14, in
import pycuda.driver as cuda
ModuleNotFoundError: No module named 'pycuda'
RTX 3060
while importing tensor flow as import tensorflow it raise an error,:
import tensorflow
Traceback (most recent call last):
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_init_.py", line 41, in
from tensorflow.python.tools import module_util as module_util
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python_init.py", line 40, in
from tensorflow.python.eager import context
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\eager\context.py", line 35, in
from tensorflow.python import pywrap_tfe
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
Failed to load the native TensorFlow runtime.
I've had similar issue but I'm not sure if the solution is applicable here, too. Anyway, I'd suggest to install the MS Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 if you haven't done it yet.
You can find the redistributable here.
I wanted to import geopandas as gpd, but the error message appears
ModuleNotFoundError: No module named 'pandas.api.extensions'.
What I have to do, to import geopandas?
I installed geopandas via anaconda promt:
C:\Users\sar>conda install -c conda-forge geopandas
Collecting package metadata (current_repodata.json): done
Solving environment: done
All requested packages already installed.
When i import geopandas, following code is shown in the console:
import geopandas as gpd
Traceback (most recent call last):
File "<ipython-input-16-a62d01c1d62e>", line 1, in <module>
import geopandas as gpd
File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\__init__.py", line 1, in <module>
from geopandas.geoseries import GeoSeries # noqa
File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\geoseries.py", line 15, in <module>
from geopandas.base import GeoPandasBase, _delegate_property
File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\base.py", line 13, in <module>
from .array import GeometryArray, GeometryDtype
File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\array.py", line 7, in <module>
from pandas.api.extensions import ExtensionArray, ExtensionDtype
ModuleNotFoundError: No module named 'pandas.api.extensions'
in array.py this code is not found:
from pandas.api.extensions import ExtensionArray, ExtensionDtype
Traceback (most recent call last):
File "/Users/codymitchell/Documents/code/py/zipline/venv/bin/jupyter-notebook", line 6, in <module>
from notebook.notebookapp import main
File "/Users/codymitchell/Documents/code/py/zipline/venv/lib/python3.5/site-packages/notebook/__init__.py", line 25, in <module>
from .nbextensions import install_nbextension
File "/Users/codymitchell/Documents/code/py/zipline/venv/lib/python3.5/site-packages/notebook/nbextensions.py", line 610, in <module>
from .extensions import (
File "/Users/codymitchell/Documents/code/py/zipline/venv/lib/python3.5/site-packages/notebook/extensions.py", line 8, in <module>
from tornado.log import LogFormatter
File "/Users/codymitchell/Documents/code/py/zipline/venv/lib/python3.5/site-packages/tornado/log.py", line 34, in <module>
from tornado.escape import _unicode
File "/Users/codymitchell/Documents/code/py/zipline/venv/lib/python3.5/site-packages/tornado/escape.py", line 27, in <module>
from tornado.util import unicode_type
File "/Users/codymitchell/Documents/code/py/zipline/venv/lib/python3.5/site-packages/tornado/util.py", line 21, in <module>
from typing import (
ImportError: cannot import name 'Type'
I had the same issue, here's how I solved it
Python 3.5.1 doesn't have typing.Type
https://github.com/django-extensions/django-extensions/issues/1188
C:\Users\rigupta>D:\Anaconda3\python
Python 3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import typing
>>> typing.Type
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'typing' has no attribute 'Type'
>>> typing.type
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'typing' has no attribute 'type'
>>>
so I upgraded my python version to 3.5.4 by running below command which resolved the issue
conda update --all
https://www.youtube.com/watch?v=Q-dZCAk1tfc
I had the exact same problem. I am running windows 7 64-bit, running on Portable Python 3.7.3.
When Jupyter was failing, I was running Portable Python at this path:
E:\applications\python37\Portable Python-3.7.3\App\Python
Uninstalling and reinstalling Jupyter, typing modules did not solve the problem.
I was suspicions of problematic path-names, so I copied the python installation to a path without whitespaces (and maybe a shorter path?):
E:\applications\python37\Python
Finally, I managed to get Jupyter Notebook to work!
I am now trying to extract keywords by using IBM Watson Natural Language Understanding API. I follow the instruction and have installed the watson_developer_cloud. However, I met an error when import the NaturalLanguageUnderstandingV1. Could you help me with it? Thank you!
from watson_developer_cloud import NaturalLanguageUnderstandingV1
Traceback (most recent call last):
File "<ipython-input-11-ab5aa6f014f4>", line 1, in <module>
from watson_developer_cloud import NaturalLanguageUnderstandingV1
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-
packages\watson_developer_cloud\__init__.py", line 30, in <module>
rom .speech_to_text_v1 import SpeechToTextV1
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-
packages\watson_developer_cloud\speech_to_text_v1.py", line 74, in <module>
from watson_developer_cloud.websocket import RecognizeCallback, RecognizeListener
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-packages\watson_developer_cloud\websocket\__init__.py", line 18, in <module>
from .speech_to_text_websocket_listener import RecognizeListener
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-packages\watson_developer_cloud\websocket\speech_to_text_websocket_listener.py", line 21, in <module>
from twisted.internet import ssl, reactor
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-packages\twisted\internet\ssl.py", line 59, in <module>
from OpenSSL import SSL
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-packages\OpenSSL\crypto.py", line 16, in <module>
from OpenSSL._util import (
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "C:\Users\yipin\Anaconda3\envs\tensorflow\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: The operating system cannot run %1.
After reinstalling the watson-cloud-developer as an administrator. I solve the problem. It seems that if we do not run the pip install command as an administrator, then the package cannot be installed correctly.