ImportError: when I use quandl module in python
Traceback (most recent call last):
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\workspace\python\stock-lab\agent\quandl.py", line 1, in <module>
import quandl
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\quandl\__init__.py", line 7, in <module>
from .model.database import Database
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\quandl\model\database.py", line 5, in <module>
import quandl.model.dataset
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\quandl\model\dataset.py", line 5, in <module>
from .data import Data
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\quandl\model\data.py", line 1, in <module>
from quandl.operations.data_list import DataListOperation
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\quandl\operations\data_list.py", line 1, in <module>
from quandl.model.data_list import DataList
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\quandl\model\data_list.py", line 2, in <module>
from .data_mixin import DataMixin
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\quandl\model\data_mixin.py", line 1, in <module>
import pandas as pd
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\__init__.py", line 55, in <module>
from pandas.core.api import (
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\core\api.py", line 29, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\core\groupby\__init__.py", line 1, in <module>
from pandas.core.groupby.generic import DataFrameGroupBy, NamedAgg, SeriesGroupBy
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\core\groupby\generic.py", line 60, in <module>
from pandas.core.frame import DataFrame
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\core\frame.py", line 124, in <module>
from pandas.core.series import Series
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\core\series.py", line 4572, in <module>
Series._add_series_or_dataframe_operations()
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\core\generic.py", line 10349, in _add_series_or_dataframe_operations
from pandas.core.window import EWM, Expanding, Rolling, Window
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\core\window\__init__.py", line 1, in <module>
from pandas.core.window.ewm import EWM # noqa:F401
File "C:\Users\vopl1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\core\window\ewm.py", line 5, in <module>
import pandas._libs.window.aggregations as window_aggregations
ImportError: DLL load failed: 지정된 모듈을 찾을 수 없습니다.
I did several things, but I don't know why the module was not available
I installed quandl
as followed :
pip install quandl
I made my under python code
import quandl
quandl.ApiConfig.api_key = '##############'
data = quandl.get('BCHARTS/BITFLYERUSD', start_date='2019-03-07', end_date='2020-05-02')
print(data)
I call my pthon code
python -m myPythonCode
and then, I saw the error.
So I deleted and installed, but failed.
So I installed as followed :
pip3 install quandl
this is still failed.
if uninstall quandl and then call my python code, I can see error :
ModuleNotFoundError: No module named 'quandl'
Plz, Help me.
When the error is DLL related, many times it can be resolved by installing the Microsoft Visual C++ Redistributable that is most likely missing.
Microsoft Visual C++
Related
Traceback (most recent call last):
File "C:\Users\mohammadprgrm\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\mohammadprgrm\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\mohammadprgrm\Desktop\py\env\Scripts\shub.exe\__main__.py", line 4, in <module>
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\shub\tool.py", line 7, in <module>
from shub.utils import update_available
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\shub\utils.py", line 42, in <module>
from scrapinghub import ScrapinghubClient, ScrapinghubAPIError, HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\__init__.py", line 13, in <module>
from .hubstorage import HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\__init__.py", line 6, in <module>
from .client import HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\client.py", line 8, in <module>
from .project import Project
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\project.py", line 3, in <module>
from .job import Job
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\job.py", line 2, in <module>
from .resourcetype import (ItemsResourceType, DownloadableResource,
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\resourcetype.py", line 5, in <module>
from collections import MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' (C:\Users\mohammadprgrm\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
That version of the scrapinghub package is evidently not compatible with Python 3.10.
Downgrade to Python 3.9, or upgrade the package to a new, compatible version if there is one which there may not be yet: https://github.com/scrapinghub/python-scrapinghub/issues/160
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\ggtools\gg\__init__.py", line 116, in <module>
from .gsm_utils import print_gsm_date_coverage,gsm_download,read_gsm,gsm_average
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\ggtools\gg\gsm_utils.py", line 8, in <module>
from .utils import print_error_grace
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\ggtools\gg\utils.py", line 2, in <module>
from sphericalpolygon import create_polygon
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\sphericalpolygon\__init__.py", line 13, in <module>
from .create_polygon import create_polygon
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\sphericalpolygon\create_polygon.py", line 2, in <module>
from .polygonclasses.sphericalpolygon import Sphericalpolygon
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\sphericalpolygon\polygonclasses\sphericalpolygon.py", line 2, in <module>
from ..inside_polygon import inside_polygon
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\sphericalpolygon\inside_polygon.py", line 2, in <module>
from scipy.spatial.transform import Rotation
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\spatial\__init__.py", line 99, in <module>
from .qhull import *
ImportError: DLL load failed: The specified module could not be found.
In my case the issue was that the create_polygon function was replaced with 'from_array' and 'from_file' in version 1.2.1 of sphericalpolygon. Downgrading to version 1.2.0 solved the issue: pip install sphericalpolygon==1.2.0
This question already has answers here:
Importing installed package from script with the same name raises "AttributeError: module has no attribute" or an ImportError or NameError
(2 answers)
Closed 4 years ago.
I'm on Windows 10 and used pip to install spacy but am now getting an error when running
import spacy
in python shell.
My error message is:
Traceback (most recent call last):
File "C:\Users\Administrator\errbot-root\plugins\utility\model_training_test.py", line 17, in <module>
import spacy
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\spacy\__init__.py", line 4, in <module>
from .cli.info import info as cli_info
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\spacy\cli\__init__.py", line 1, in <module>
from .download import download
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\spacy\cli\download.py", line 5, in <module>
import requests
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\__init__.py", line 43, in <module>
import urllib3
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 11, in <module>
from .exceptions import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\packages\six.py", line 203, in load_module
mod = mod._resolve()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\packages\six.py", line 115, in _resolve
return _import_module(self.mod)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module
__import__(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 71, in <module>
import email.parser
File "C:\Users\Administrator\errbot-root\plugins\utility\email.py", line 1, in <module>
from errbot import BotPlugin, botcmd, arg_botcmd, webhook
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\errbot\__init__.py", line 12, in <module>
from .core_plugins.wsview import bottle_app, WebView
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\errbot\core_plugins\wsview.py", line 5, in <module>
from bottle import Bottle, request
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\bottle.py", line 38, in <module>
import base64, cgi, email.utils, functools, hmac, imp, itertools, mimetypes,\
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\cgi.py", line 39, in <module>
from email.parser import FeedParser
ModuleNotFoundError: No module named 'email.parser'; 'email' is not a package
Edit: When trying to pip install email, i get the following error:
Collecting email
Using cached https://files.pythonhosted.org/packages/71/e7/816030d3b0426c130040bd068be62b9213357ed02896f5d9badcf46d1b5
f/email-4.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\setuptools\__init__.py", lin
e 12, in <module>
import setuptools.version
File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\setuptools\version.py", line
1, in <module>
import pkg_resources
File
"c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py",
line 36, in <module>
import email.parser
File "C:\Users\ADMINI~1\AppData\Local\Temp\2\pip-install-
p378w8he\email\email\parser.py", line 10, in <module>
from cStringIO import StringIO
ModuleNotFoundError: No module named 'cStringIO'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\ADMINI~1\AppData\Local\Temp\2\pip-install-p378w8
he\email\
SpaCy had been installed properly, there was simply another file named email.py that was interfering with the standard library email. Don't name your files after standard libraries.
I am struggling because of the error
AttributeError: module 'pandas' has no attribute 'core'
since quite a long time please refer the output of "import pandas" below. I have searched for this error on the net and searched at many places tried many things but was unable to resolve it. The problem was the solutions provided were more realted to other operating systems like Mac and Linux while I am using Windows 7 Professional.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\api.py", line 10, in <module>
from pandas.core.groupby.groupby import Grouper
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\groupby\__init__.py", line 2, in <module>
from pandas.core.groupby.groupby import (
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\groupby\groupby.py", line 49, in <module>
from pandas.core.frame import DataFrame
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\frame.py", line 74, in <module>
from pandas.core.series import Series
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\series.py", line 66, in <module>
import pandas.core.ops as ops
AttributeError: module 'pandas' has no attribute 'core'
Please do ask if you need any other details. I will be really gratified if you help me through this.
Thankyou
P.S if you can suggest a solution which does not use internet using terminal such as in case of "pip install pandas" as the company's network access is restricted. So, I installed all the dependencies of pandas through whl files which are downloadable through the access the company has provided.
Edit: The first time I execute pandas it shows and rest it shows the error shown above
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\api.py", line 10, in <module>
from pandas.core.groupby.groupby import Grouper
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\groupby\__init__.py", line 2, in <module>
from pandas.core.groupby.groupby import (
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\groupby\groupby.py", line 49, in <module>
from pandas.core.frame import DataFrame
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\frame.py", line 74, in <module>
from pandas.core.series import Series
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\series.py", line 3978, in <module>
Series._add_series_or_dataframe_operations()
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\generic.py", line 8891, in _add_series_or_dataframe_operations
from pandas.core import window as rwindow
File "C:\Users\IshanL\PycharmProjects\Project1\venv\lib\site-packages\pandas\core\window.py", line 36, in <module>
import pandas._libs.window as _window
ImportError: DLL load failed: The specified module could not be found.
conda upgrade --all
Upgrade your library and restart your notebook.This will do the work.
I somehow messed up my python and am running out of ideas how to fix it. I am using Python 2.7.6. on a Windows computer. Basically anything connected to xml stopped working. Meaning: it worked fine before, then the console crashed, and now I get the error described.
When I write
pip install numpy
in the console I get the following error:
Traceback (most recent call last):
File "C:\Python27\Scripts\pip-script.py", line 9, in <module>
load_entry_point('pip==1.5.2', 'console_scripts', 'pip')()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 351, in load_entry
_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2363, in load_entr
y_point
return ep.load()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "C:\Python27\lib\site-packages\pip\__init__.py", line 11, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "C:\Python27\lib\site-packages\pip\vcs\subversion.py", line 4, in <module
>
from pip.index import Link
File "C:\Python27\lib\site-packages\pip\index.py", line 18, in <module>
import html5lib
File "C:\Python27\lib\site-packages\html5lib\__init__.py", line 16, in <module
>
from .html5parser import HTMLParser, parse, parseFragment
File "C:\Python27\lib\site-packages\html5lib\html5parser.py", line 6, in <modu
le>
from . import inputstream
File "C:\Python27\lib\site-packages\html5lib\inputstream.py", line 10, in <mod
ule>
from . import utils
File "C:\Python27\lib\site-packages\html5lib\utils.py", line 8, in <module>
import xml.etree.ElementTree as default_etree
ImportError: No module named etree.ElementTree
What I did so far: I tried to reinstall the xml package (which was suggested in the forum). I also installed Anaconda with various environments. There, the problem is visible when I want to use packages like openpyxl, which gives me a similar error message:
Traceback (most recent call last):
File "HU_calc.py", line 1, in <module>
import openpyxl as px
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\__init__.py", line 29
, in <module>
from openpyxl.workbook import Workbook
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\workbook\__init__.py"
, line 5, in <module>
from .workbook import Workbook
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\workbook\workbook.py"
, line 7, in <module>
from openpyxl.worksheet import Worksheet
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\worksheet\__init__.py
", line 4, in <module>
from .worksheet import Worksheet
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\worksheet\worksheet.p
y", line 35, in <module>
from openpyxl.cell import Cell
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\cell\__init__.py", li
ne 4, in <module>
from .cell import Cell, WriteOnlyCell
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\cell\cell.py", line 4
5, in <module>
from openpyxl.styles import numbers, is_date_format
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\styles\__init__.py",
line 5, in <module>
from .alignment import Alignment
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\styles\alignment.py",
line 6, in <module>
from openpyxl.descriptors import Bool, MinMax, Min, Alias, NoneSet
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\descriptors\__init__.
py", line 5, in <module>
from .sequence import Sequence
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\descriptors\sequence.
py", line 5, in <module>
from openpyxl.xml.functions import Element
File "D:\anaconda3\envs\py278\lib\site-packages\openpyxl\xml\functions.py", li
ne 28, in <module>
from xml.etree.cElementTree import iterparse
ImportError: No module named etree.cElementTree
This is especially confusing to me, as I thought Anaconda would create a python environment completely isolated from the Windows one. I feel like I am missing something very obvious. If there's anything missing/unclear in my question, I'll fix that as soon as possible.
I'd be very grateful for every advice.
Looks like you have a python script named xml.py. Rename that and it should work.