After I installed zipline with the anaconda prompt everything was imported and installed correctly. But in the Jupyter notebook, I am getting error like no module called 'matplotlib' or pandas 'DataReader' is not working. When I try to install it in the notebook and restart the kernel, the zipline import is no longer working. How can I solve this? What is wrong with the zipline installation?
zipline has very specific dependencies like pandas 0.18.0 and pandas DataReader 0.8.0. So make sure you have the correct version of those. And by the way, I find the tutorial here very useful.
Hope it could help
Related
input:
import pandas
output:
ModuleNotFoundError: No module named 'pandas'
I installed the package with the command line - pip3 install pandas,
my python version is 3.10.7
The source of the installed panda package: c:\users\kfirs\appdata\local\programs\python\python310\lib\site-packages
not sure if this will help but in the command prompt type pip --version check to make sure you're on a version that is fluent with pandas, don't know much about pandas but I assume you should try and do the same with pandas. My knowledge is limited but try installing on the same drive as python as this could possibly be why things are not working. 3rd sometimes I have issues with windows after installing pip packs so try restarting your pc sometimes my imports right after installing don't work and this usually fixes but only if it's truly installed where it needs to be and the version needed. Hope I could help.
I recently installed anaconda and was using jupyter notebook to write my code. I also installed Visual Studio code and ran my jupyter files (.ipynb) in VSC.
Whenever I try to import pandas in VSC within a jupyter file (.ipynb), I get an error that says ModuleNotFoundError: No module named 'pandas'. However, when I run the same file in Chrome on the Jupyter notebook website, I get no such error and my file is able to import pandas.
How can I fix the problem?
This is due to the fact that when you open an .ipynb file in jupyter-notebook, it is running in a conda environment with pandas installed. And it is running on VSC in a Windows or OS environment, which may not have pandas installed.
On cmd run, pip install pandas then import it on VSC.
I think you are working on a different environment and the error is occurring because pandas module is in different path try installing pandas in your current environment and importing it might work
This might help..
https://code.visualstudio.com/docs/python/environments
Thanks for the above comments. On cmd run (pip show pandas), it actually showed pandas was installed.
However, the reason was because the selected interpreter was a non-conda version, which can be changed in the top right of VCS. Hope this helps anyone who has a similar issue!
I am Windows and using python through jupyternotebook.
python 3.9.7, windows 64 bit,
I want to import geopandas, so I used the code conda install --channel conda-forge geopandas. It seemed work at first because I could successfully import geopandas without error, but when I want to run the following code, an import error appears.
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
world.columns
ImportError: the 'read_file' function requires the 'fiona' package, but it is not installed or does not import correctly.
Importing fiona resulted in: DLL load failed while importing ogrext
I saw other people asked the same questions, but none of their solutions worked. At first, I saw someone said nstalling geopandas by condas might installed wrong version of fiona and gdal. So I tried to update by conda update conda, and conda update -n base conda-package-handling and conda update --all. However, these code didn't work. Later, I directly installed the .whl file from python library: Fiona-1.8.20-cp39-cp39-win_amd64.whl and GDAL-3.4.1-cp39-cp39-win_amd64.whl, and use pip to install them. But the error still appeared.
I really have no idea how to deal with such issue, is it because the version of fiona and gdal was not consistent? Please give me some suggestions, thanks ahead!
I have solved this problem by creating a new environment followed this article: https://medium.com/analytics-vidhya/fastest-way-to-install-geopandas-in-jupyter-notebook-on-windows-8f734e11fa2b
This is the fast way to solve this problem.
Hey there I am relatively new to python. I have a hw assignment and it requires me to use an initial import of (import plotly.express as px). When I run the code it returns to me this (module 'pandas' has no attribute 'Panel'). I am using jupyter lab and I have been told that it has a lot of issues with plotly. I have also tried using jupyter notebook but still the same error. Some of my download versions include:
Python-dotenv : 0.16.0
Python : 3.7.9
Nb_conda : 2.2.1
Nodejs : 14.8.0
Npm : 6.14.7
Holoviz : 0.11.3
Plotly : 4.14.3
Pandas : 1.2.4
Please let me know if you have any solutions to this problem. Thanks
As the Pandas' documentation states, the Panel attribute has been deprecated since version 0.20.0. You are using a version of Pandas (1.2.4) which does not have this attribute anymore. In other words, your code is too old for the version of Pandas in Jupyter Lab.
To solve this, you should follow the documentation and update the code to use either an xarray or a MultiIndex as a replacement to Panel.
Alternatively, a quick and dirty to solve this specific issue is to install a downgraded version of Pandas, but you'll probably have to downgrade a lot of other packages too. So I cannot recommend this option. Anyway, you can do this by adding a cell with this command, before the import and then restarting your notebook environment:
!pip install pandas==0.19.2
I've been struggling with plotly.express and pandas in jupyter notebook as well.
I've recently upgraded pandas to 1.3.0 and plolty to 5.1.0.
I had the same error, make sure you upgrade all dependencies as well along with pandas and plotly.
For me this command in the console did the trick:
pip install xarray --upgrade
I was trying to run some commands that needed me to update pandas, and then numpy, and so I did. Problem is now, when I try to look into a DataFrame in the variable explorer, they don't open and I get this error instead:
ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package
Do you know what is happening?
I had the same problem. I solved it installing the pandas version 0.24.2
pip install pandas==0.24.2