I have a new MacBook Pro M1 with mini-forge, arch i386 and am trying to run Pandas without success.
As an example, I have a python script with "import pandas as pd" (line 1) which returns error because it can not find Pandas.
File "test.py", line 1, in
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
I have tried to run (and installed) Pandas both in and outside of en environment installed Pandas both in and outside of an environment but none is recognised and returns the error.
I have installed Pandas - Thats not the problem here.
Do you have any idea of possible solutions for such problem?
The simplest approach for installing pandas is to install it as part of the Anaconda distribution
conda create - n name_of_my_env
source activate name_of_my_env
activate name_of_my_env
conda install pandas
conda install pandas = 0.20 .3
As seen here
You need to install numpy first in your environment, this worked for me:
python3 -m pip install virtualenv
virtualenv -p python3.8 venv
source venv/bin/activate
pip install --upgrade pip
pip install numpy cython
git clone https://github.com/pandas-dev/pandas.git
cd pandas
python3 setup.py install
As seen here: how to install pandas on m1 Mac
How did you install pandas? As I also have M1 Macbook, it is no matter.
Maybe you can check if directory which you installed pandas is in sys.path directories.
Related
how to install numpy and pandas in python 2.7.9 version using command line.
please help with complete installing process.
I have tried in windows 10 OS , but it's not installed . Showing syntax error.
I have used command in python 2.7.9 as below
pip install numpy / python -m pip install numpy
pip install pandas / python -m pip install pandas
make sure you havent opened python interpreter like so
open command prompt then run the command
also make sure environment variables are set
First I recommend you upgrade Python Package otherwise try to find which NumPy version supports python 2.7.9 then install like this pip install numpy==1.9.2
[https://stackoverflow.com/questions/28947345/which-numpy-library-is-compatible-with-python-2-7-9]
I have installed miniforge on my mac , in that using a 'local env' on jupyter notebook. I can't change the numpy version (need to downgrade to 1.19.5) on this kernel, have tried:
(1)pip install numpy==1.19.5 &
(2)conda install -c conda-forge numpy=1.19.5.
numpy version seems to be changing easily on conda-ipython3 kernel, but my project is running on 'local env'
very new to all this, still learning. Please help
first make sure that your local environment is activated by running: .../{your venv folder path}/Scripts/activate. Because if you install numpy on the wrong virtual environment then it won't work.
Then uninstall numpy by running pip uninstall numpy. Then install the numpy version you want.
You can do the following to ensure you have desired numpy version:
Activate your local environment
Uninstall any previously installed numpy version by using:
pip uninstall numpy
Install the desired numpy version:
pip install numpy=1.19.5
Check the installed version of numpy:
pip freeze
If you want to export the package list use:
pip freeze > requirements.txt
I want to create an .exe file and get this error: Failed to import module _Pyinstaller_hooks_0_pandas_io_formats_style required for module C:xxxxxx\site-packages\Pyinstaller\hooks\hook-pandas.io.format.style.py.
I am not familiar with this subject at all and couldt find anything that could resolve the issue by using google. Any help would be very much appreciated!!
This happened when freezing pandas inside conda environment using pyinstaller.
I had pandas installed using conda environment and also using pip like pip install pandas.
I removed the pip version and installed using conda, and that worked!
pip uninstall pandas
conda install -c conda-forge pandas
I am using anaconda and just tried:
pip install modin
that finished without issue.
Then created very simple python script and in it only have one line:
import modin.pandas as pd
Error that I am getting:
ModuleNotFoundError: No module named 'modin.pandas'; 'modin' is not a package
If I use regular panda package - all works fine.
In addition tried:
pip install --upgrade pip
pip install pandas==0.23.4 --force-reinstall
pip install modin --force-reinstall
pip install ray --force-reinstall
But that did not help (same error).
What should be done?
You should use:
pip install modin[ray] as python suggests
Try work in an environment:
conda create --name modin python=3.6 pandas modin --channel conda-forge
So we created environment called modin with Python 3.6. pandas and mod in from conda-forge channel. Let conda deal with extra-requirements. Activate the environment and install other packages.
Note ray is yet to be support in Windows. Windows usera use WSL
conda activate modin
conda install ray -c bioconda
Test if everything is okay:
python -c "import modin.pandas as pd"
If no error! You are good to go!
If you are using Anaconda environment then you should firstly install modin through following command:
conda install -c conda-forge modin
Then import
import modin.padas as pd
This pip install 'modin[dask]'works for me.
I am using Python 3.9.
what is your script name? I had same issue when I named my script as modin.py. After I renamed it to something else, the issue was gone.
In a virtual env, after installing numpy without problems i run
pip3 install pandas
which returns:
EDIT:
Collecting pandas
Using cached https://files.pythonhosted.org/packages/08/01/803834bc8a4e708aedebb133095a88a4dad9f45bbaf5ad777d2bea543c7e/pandas-0.22.0.tar.gz
Installing build dependencies ... error
Complete output from command /home/bonzay/Desktop/Final_Project/venv/bin/python3.4 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-4pcvmc12 https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl#sha256=80044e51ec5bbf6c894ba0bc48d26a8c20a9ba629f4ca19ea26ecfcf87685f5f https://files.pythonhosted.org/packages/8c/10/79282747f9169f21c053c562a0baa21815a8c7879be97abd930dbcf862e8/setuptools-39.1.0-py2.py3-none-any.whl#sha256=0cb8b8625bfdcc2d43ea4b9cdba0b39b2b7befc04f3088897031082aa16ce186 https://files.pythonhosted.org/packages/70/25/1e1521e6ce2cf78ff4a8b06fbc2cd513ce004ec337000eddfe016fdf3fc6/Cython-0.28.2-cp34-cp34m-manylinux1_x86_64.whl#sha256=85f7432776870d65639fed00f951a3c05ef1e534bc72a73cd1200d79b9a7d7d0 https://files.pythonhosted.org/packages/fc/1b/a1717502572587c724858862fd9b98a66105f3a3443225bda9a1bd16ee14/numpy-1.9.3-cp34-cp34m-manylinux1_x86_64.whl#sha256=bff36563f9d6a06a81ae232f49d2946c84c05e391a7dff057496033c79507860 https://files.pythonhosted.org/packages/02/64/c6c1c24ff4dbcd789fcfdb782e343ac23c074f6b8b03e818ff60eb0f937f/numpy-1.12.1-cp34-cp34m-manylinux1_x86_64.whl#sha256=4eac5f2f624c5e7eecbdb51395ff39a099c48cab607a158f16f288c6fe39a2b3 https://files.pythonhosted.org/packages/1b/ee/f65826b2880f67652c21326565b4c166c7cdb1019f84b82af65e625475cd/numpy-1.13.1-cp34-cp34m-manylinux1_x86_64.whl#sha256=838e48df3703c8747f355cd6386e0680b906a2f7b2bbd304e8a2d531692484ce:
Double requirement given: numpy==1.12.1 from https://files.pythonhosted.org/packages/02/64/c6c1c24ff4dbcd789fcfdb782e343ac23c074f6b8b03e818ff60eb0f937f/numpy-1.12.1-cp34-cp34m-manylinux1_x86_64.whl#sha256=4eac5f2f624c5e7eecbdb51395ff39a099c48cab607a158f16f288c6fe39a2b3 (already in numpy==1.9.3 from https://files.pythonhosted.org/packages/fc/1b/a1717502572587c724858862fd9b98a66105f3a3443225bda9a1bd16ee14/numpy-1.9.3-cp34-cp34m-manylinux1_x86_64.whl#sha256=bff36563f9d6a06a81ae232f49d2946c84c05e391a7dff057496033c79507860, name='numpy')
Both numpy and pandas are installed globally with no problems. I tried re installing numpy, upgrading pip3, re installing setup tools. Nothing worked as expected, as i don't even understand the error message.
I had the same issue! [Ubuntu 16, python 3.5] After creating my virtual environment using python3 -m venv .env, I could not install pandas in my .env virtual environment. This is how I fixed it:
The pip version of my virtualenv was pip-8.1.1. I ran the following command to upgrade it to pip-20.0.2:
pip install --upgrade pip
Then, ran pip install pandas to install pandas successfully within my virtual env!
Successfully installed numpy-1.18.1 pandas-0.24.2 python-dateutil-2.8.1 pytz-2019.3 six-1.14.0
found this which did the job for me:
Double requirement given when trying to use pip install pandas
Double requirement given when trying to use pip install pandas
pip3 install 'pandas<0.21'
Not sure what is your problem. You should post what all you have done from the very beginning. Have you activated your virtualenv?
If you haven't this is how you can do it:
virtualenv venv
venv/bin/activate