So I am trying to install zipline and zipline live. I have installed all of the main packages needed for this, and when I do pip install zipline I get no errors. But then when I go into python and do import zipline I get the error:
>>> import zipline
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Benito\AppData\Local\Programs\Python\Python36\lib\site-packages\zipline\__init__.py", line 20, in <module>
from . import data
File "C:\Users\Benito\AppData\Local\Programs\Python\Python36\lib\site-packages\zipline\data\__init__.py", line 1, in <module>
from . import loader
File "C:\Users\Benito\AppData\Local\Programs\Python\Python36\lib\site-packages\zipline\data\loader.py", line 20, in <module>
from pandas_datareader.data import DataReader
File "C:\Users\Benito\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas_datareader\__init__.py", line 2, in <module>
from .data import (
File "C:\Users\Benito\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas_datareader\data.py", line 9, in <module>
from pandas.util._decorators import deprecate_kwarg
ModuleNotFoundError: No module named 'pandas.util._decorators'
I have tired pip install pandas.util._decorators but this has not worked. I also tried changing to a more up-to-date pandas, but zipline and zipline live do not support this . Right now I have pandas 0.18.1
Related
I just did a conda install of a few packages to follow a tutorial, and now I can't even import pandas.
I installed these:
fake-factory==0.7.2
Faker==0.7.3
pytz==2016.7
tzlocal==1.3.0
And now I get this:
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\api.py", line 7, in <module>
from pandas.core.arrays.integer import (
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\arrays\__init__.py", line 2, in <module>
from .base import (ExtensionArray, # noqa
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\arrays\base.py", line 21, in <module>
from pandas.core import ops
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\ops\__init__.py", line 21, in <module>
from pandas.core.construction import extract_array
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\construction.py", line 18, in <module>
from pandas.core.dtypes.base import ExtensionDtype, registry
ImportError: cannot import name 'registry' from 'pandas.core.dtypes.base' (C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\dtypes\base.py)
I tried doing a conda update pandas, but to no avail.
I also just installed luigi, not quite sure when it broke as I installed all the additional packages in one go.
Updated version of pandas package using pip3
try this in python3
pip3 install --upgrade pandas
Try updating pandas package in Anaconda:
conda install pandas=1.1.4
If no luck, try updating all packages:
conda update --all
Worked in my case.
I installed librosa, and now im trying to import it
import librosa
This throws me this error for some reason
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\__init__.py", line 12, in <module>
from . import core
File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\core\__init__.py", line 125, in <module>
from .time_frequency import * # pylint: disable=wildcard-import
File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\core\time_frequency.py", line 11, in <module>
from ..util.exceptions import ParameterError
File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\util\__init__.py", line 77, in <module>
from .utils import * # pylint: disable=wildcard-import
File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\util\utils.py", line 15, in <module>
from .decorators import deprecated
File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\util\decorators.py", line 9, in <module>
from numba.decorators import jit as optional_jit
ModuleNotFoundError: No module named 'numba.decorators'
Why am i getting this error even after installing the library?
You have to install numbra version 0.48 because of a bug, run
pip install numba==0.48
Librosa Issue on Github
You need to use any numba version before 0.8.0
However, the most recent librosa is not compatible with any numba below 0.48.
At least, that's what I've found from using it on Windows. My solution was to use google colaboratory as it didn't give me any error when importing librosa.
I've got the exact error. Solved it with
pip uninstall --yes librosa
pip install librosa --force-reinstall
Your python version should be 3.8.
I tried to import matplotlib and pandas, like this (but separately):
import matplotlib.pyplot
import pandas
but each time there was an error. When i imported pandas, it said
Traceback (most recent call last):
File "<pyshell#36>", line 1, in <module>
import pandas
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pandas\__init__.py", line 23, in <module>
from pandas.compat.numpy import *
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pandas\compat\__init__.py", line 439, in <module>
from dateutil import parser as _date_parser
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\dateutil\parser\__init__.py", line 2, in <module>
from ._parser import parse, parser, parserinfo
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\dateutil\parser\_parser.py", line 43, in <module>
from six import binary_type, integer_types, text_type
ImportError: cannot import name 'binary_type'
so I went on command prompt (windows) and tried pip install --upgrade pandas and pip install binary_type, but neither of them worked.
When I imported matplotlib, it said
Traceback (most recent call last):
File "<pyshell#40>", line 1, in <module>
import matplotlib.pyplot
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\matplotlib\__init__.py", line 127, in <module>
from . import cbook
File "C:\Users\bobby\AppData\Local\Programs\Python\Python35-32\lib\site-packages\matplotlib\cbook\__init__.py", line 12, in <module>
from six.moves import xrange, zip
ImportError: No module named 'six.moves'; 'six' is not a package
so like before I did pip install --upgrade six , pip install six, and pip install six.move, but none of these work.
What should I do so that both of these modules work?
I have installed the whl files for fiona, shapely, gdal, rtree and pyproj. Geopandas is also installed via pip install. But I get the following error when importing it:
import geopandas
Traceback (most recent call last):
File "<ipython-input-14-c9ee6bd24dbc>", line 1, in <module>
import geopandas
File "C:\ProgramData\Anaconda3\lib\site-packages\geopandas\__init__.py", line 1, in <module>
from geopandas.geoseries import GeoSeries
File "C:\ProgramData\Anaconda3\lib\site-packages\geopandas\geoseries.py", line 12, in <module>
from geopandas.base import GeoPandasBase, _series_unary_op, _CoordinateIndexer
File "C:\ProgramData\Anaconda3\lib\site-packages\geopandas\base.py", line 14, in <module>
from rtree.core import RTreeError
File "C:\ProgramData\Anaconda3\lib\site-packages\rtree\__init__.py", line 1, in <module>
from .index import Rtree
File "C:\ProgramData\Anaconda3\lib\site-packages\rtree\index.py", line 5, in <module>
from . import core
File "C:\ProgramData\Anaconda3\lib\site-packages\rtree\core.py", line 116, in <module>
raise OSError("could not find or load spatialindex_c.dll")
OSError: could not find or load spatialindex_c.dll
and the following error as well:
import fiona
Traceback (most recent call last):
File "<ipython-input-16-cc872b235141>", line 1, in <module>
import fiona
File "C:\ProgramData\Anaconda3\lib\site-packages\fiona\__init__.py", line 77, in <module>
from fiona.collection import Collection, BytesCollection, vsi_path
File "C:\ProgramData\Anaconda3\lib\site-packages\fiona\collection.py", line 9, in <module>
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
File "fiona\ogrext.pyx", line 25, in init fiona.ogrext
ImportError: cannot import name compat
Can somebody please help me here?
I'm not being able to figure out how to fix this issue. Thanks and regards.
You could try the installation with conda instead of pip.
conda install -c conda-forge cenpy
See the CenPy documentation: https://pypi.org/project/cenpy/
You don't need to separately install geopandas and Rtree if you use conda.
I have installed pymc using easy_install pymc command. While I try to import the package using import pymc.
I am getting following errors :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pymc-2.3.2-py2.7-linux-i686.egg/pymc/__init__.py", line 29, in <module>
from .CommonDeterministics import *
File "/usr/local/lib/python2.7/dist-packages/pymc-2.3.2-py2.7-linux-i686.egg/pymc/CommonDeterministics.py", line 21, in <module>
from .utils import safe_len, stukel_logit, stukel_invlogit, logit, invlogit, value, find_element
File "/usr/local/lib/python2.7/dist-packages/pymc-2.3.2-py2.7-linux-i686.egg/pymc/utils.py", line 14, in <module>
from . import flib
ImportError: libatlas.so.3gf: cannot open shared object file: No such file or directory
I am using Ubuntu 12.04 and Python 2.7.
What is the reason for these errors?
Try installing that missing library:
apt-get install libatlas3-base-dev