I installed pandas using anaconda prompt.
using the following command:-
pip install pandas
and get the following message:-
Requirement already satisfied: pandas in c:\users\maini_\anaconda3\lib\site-packages (1.0.3)
Requirement already satisfied: numpy>=1.13.3 in c:\users\maini_\anaconda3\lib\site-packages (from pandas) (1.18.1)
Requirement already satisfied: pytz>=2017.2 in c:\users\maini_\anaconda3\lib\site-packages (from pandas) (2020.1)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\maini_\anaconda3\lib\site-packages (from pandas) (2.8.1)
Requirement already satisfied: six>=1.5 in c:\users\maini_\anaconda3\lib\site-packages (from python-dateutil>=2.6.1->pandas) (1.15.0)
But when I import it in the Jupiter notebook using the following command:-
import pandas as pd
I get the following error:-
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-7dd3504c366f> in <module>
----> 1 import pandas as pd
~\anaconda3\lib\site-packages\pandas\__init__.py in <module>
30
31 try:
---> 32 from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
33 except ImportError as e: # pragma: no cover
34 # hack but overkill to use re
~\anaconda3\lib\site-packages\pandas\_libs\__init__.py in <module>
1 # flake8: noqa
2
----> 3 from .tslibs import (
4 NaT,
5 NaTType,
~\anaconda3\lib\site-packages\pandas\_libs\tslibs\__init__.py in <module>
1 # flake8: noqa
2
----> 3 from .conversion import localize_pydatetime, normalize_date
4 from .nattype import NaT, NaTType, iNaT, is_null_datetimelike
5 from .np_datetime import OutOfBoundsDatetime
pandas\_libs\tslibs\conversion.pyx in init pandas._libs.tslibs.conversion()
AttributeError: type object 'pandas._libs.tslibs.conversion._TSObject' has no attribute '__reduce_cython__'
I also tried this command
python -m pip install pandas
and get the following message
Requirement already satisfied: pandas in c:\users\maini_\anaconda3\lib\site-packages (1.0.3)
Requirement already satisfied: numpy>=1.13.3 in c:\users\maini_\anaconda3\lib\site-packages (from pandas) (1.18.1)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\maini_\anaconda3\lib\site-packages (from pandas) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in c:\users\maini_\anaconda3\lib\site-packages (from pandas) (2020.1)
Requirement already satisfied: six>=1.5 in c:\users\maini_\anaconda3\lib\site-packages (from python-dateutil>=2.6.1->pandas) (1.15.0)
Please help me. Thank you in advance.
Since you are using Anaconda, the best way is to use the anaconda prompt:
conda install pandas
Related
I have installed folium using both pip and conda , it got successfully installed infact conda list in particular environment also showing still i can not be able to import the folium.
#Instructions i followed to installed folium are below:-
(ML) C:\Users\24HOURS>pip3 install folium
Requirement already satisfied: folium in c:\users\24hours\miniconda3\envs\ml\lib
\site-packages (0.10.1)
Requirement already satisfied: numpy in c:\users\24hours\miniconda3\envs\ml\lib\
site-packages (from folium) (1.19.2)
Requirement already satisfied: requests in c:\users\24hours\miniconda3\envs\ml\l
ib\site-packages (from folium) (2.25.1)
Requirement already satisfied: branca>=0.3.0 in c:\users\24hours\miniconda3\envs
\ml\lib\site-packages (from folium) (0.4.2)
Requirement already satisfied: jinja2>=2.9 in c:\users\24hours\miniconda3\envs\m
l\lib\site-packages (from folium) (2.11.3)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\24hours\miniconda3\e
nvs\ml\lib\site-packages (from jinja2>=2.9->folium) (1.1.1)
Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\24hours\miniconda3\
envs\ml\lib\site-packages (from requests->folium) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in c:\users\24hours\miniconda3\envs\
ml\lib\site-packages (from requests->folium) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\24hours\minicon
da3\envs\ml\lib\site-packages (from requests->folium) (1.26.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\24hours\miniconda3
\envs\ml\lib\site-packages (from requests->folium) (2020.12.5)
conda way installation below:-
(ML) C:\Users\24HOURS>conda install -c conda-forge folium
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.9.2
latest version: 4.10.0
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: C:\Users\24HOURS\miniconda3\envs\ML
added / updated specs:
- folium
The following packages will be UPDATED:
ca-certificates conda-forge/label/cf202003::ca-certif~ --> conda-forge::ca-
certificates-2020.12.5-h5b45459_0
folium conda-forge/label/cf202003::folium-0.~ --> conda-forge::fol
ium-0.12.0-pyhd8ed1ab_1
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(ML) C:\Users\24HOURS>
Still I am getting import Error for folium
In jupyter notebook
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-173c1173bf1c> in <module>
----> 1 import folium
ModuleNotFoundError: No module named 'folium'
I have installed pytest successfully,but import error occurs "ModuleNotFoundError: No module named 'pytest'".I can see pytest in my finder but it not in the "python3 -m pip list".How can I solve it?
HelendeMacBook-Pro:bin helendai$ pip3 install pytest
Collecting pytest
Using cached pytest-5.4.1-py3-none-any.whl (246 kB)
Requirement already satisfied: more-itertools>=4.0.0 in /usr/local/lib/python3.6/site-packages (from pytest) (8.2.0)
Requirement already satisfied: packaging in /usr/local/lib/python3.6/site-packages (from pytest) (20.3)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.6/site-packages (from pytest) (19.3.0)
Requirement already satisfied: pluggy<1.0,>=0.12 in /usr/local/lib/python3.6/site-packages (from pytest) (0.13.1)
Requirement already satisfied: py>=1.5.0 in /usr/local/lib/python3.6/site-packages (from pytest) (1.8.1)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.6/site-packages (from pytest) (0.1.9)
Requirement already satisfied: importlib-metadata>=0.12; python_version < "3.8" in /usr/local/lib/python3.6/site-packages (from pytest) (1.6.0)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.6/site-packages (from packaging->pytest) (2.4.7)
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from packaging->pytest) (1.14.0)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.6/site-packages (from importlib-metadata>=0.12; python_version < "3.8"->pytest) (3.1.0)
Installing collected packages: pytest
Successfully installed pytest-5.4.1
HelendeMacBook-Pro:bin helendai$ python3 -m pip list
Package Version
------------ ----------
certifi 2019.11.28
cffi 1.14.0
chardet 3.0.4
cryptography 2.8
idna 2.9
pip 20.0.2
pycparser 2.20
pyOpenSSL 19.1.0
PyYAML 5.3
requests 2.23.0
setuptools 41.2.0
six 1.14.0
urllib3 1.25.8
HelendeMacBook-Pro:bin helendai$ python3
Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pytest'
enter image description here
perhaps you had installed multiple python on your computer, because the install logs show pytest is installed on python 3.6, but the python shell show your python version is 3.8.2
I have followed this method to run a box2d enviroment without rendering it in google colab,
!apt-get install python-box2d
!pip install box2d-py
!pip install gym[Box_2D]
import gym
env = gym.make("BipedalWalker-v2")
but its showing this
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-box2d is already the newest version (2.3.2~dfsg-2).
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
Requirement already satisfied: box2d-py in /usr/local/lib/python3.6/dist-packages (2.3.8)
Requirement already satisfied: gym[Box_2D] in /usr/local/lib/python3.6/dist-packages (0.15.3)
WARNING: gym 0.15.3 does not provide the extra 'box_2d'
Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from gym[Box_2D]) (1.12.0)
Requirement already satisfied: pyglet<=1.3.2,>=1.2.0 in /usr/local/lib/python3.6/dist-packages (from gym[Box_2D]) (1.3.2)
Requirement already satisfied: numpy>=1.10.4 in /usr/local/lib/python3.6/dist-packages (from gym[Box_2D]) (1.17.3)
Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from gym[Box_2D]) (1.3.1)
Requirement already satisfied: cloudpickle~=1.2.0 in /usr/local/lib/python3.6/dist-packages (from gym[Box_2D]) (1.2.2)
Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from pyglet<=1.3.2,>=1.2.0->gym[Box_2D]) (0.16.0)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-10-62ca95674145> in <module>()
3 get_ipython().system('pip install gym[Box_2D]')
4 import gym
----> 5 env = gym.make("BipedalWalker-v2")
3 frames
/usr/local/lib/python3.6/dist-packages/gym/envs/registration.py in load(name)
16 mod_name, attr_name = name.split(":")
17 mod = importlib.import_module(mod_name)
---> 18 fn = getattr(mod, attr_name)
19 return fn
20
AttributeError: module 'gym.envs.box2d' has no attribute 'BipedalWalker'
I also tried to install this box2d from pip pip install Box2D but its not installing in colab. How do we install and run a box2d gym enviroment in google colag?
I was able to get it working with !pip3 install box2d-py==2.3.8.
Please create a new Colab notebook, Click on File -> New notebook. On a new (fresh) Colab execute these:
!pip3 install box2d-py
!pip3 install gym[Box_2D]
import gym
env = gym.make("BipedalWalker-v3")
The gym is installed by default in the new notebook however you have to install the box2d-py and gym[Box_2D]. Please close the current notebook if you have encountered the error. Simply use a new notebook (VERY IMPORTANT) and go on with above procedure of pip install. It will work!
Can anyone help in providing the steps to install Spacy package? I am facing a lot of difficulties in setting it up without an internet connection. Facing a lot of errors. Steps would be really helpful.
As of now I manually downloaded the dependencies (whl files) and installed. Spacy package is also successfully installed. But when I tried to import I am facing the problem.
(base) C:\Windows\system32>pip install E:/PythonPacakges/spacy-2.0.16-cp36-cp36m-win_amd64.whl
Requirement already satisfied: spacy==2.0.16 from file:///E:/PythonPacakges/spacy-2.0.16-cp36-cp36m-win_amd64.whl in d:\programdata\anaconda3\lib\site-packages (2.0.16)
Requirement already satisfied: preshed>=2.0.1 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (2.0.1)
Requirement already satisfied: plac>=0.9.6 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (0.9.6)
Requirement already satisfied: dill>=0.2 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (0.2.8.2)
Requirement already satisfied: msgpack-numpy in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (0.4.4.2)
Requirement already satisfied: cymem>=2.0.2 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (2.0.2)
Requirement already satisfied: regex>=2018.01.10 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (2018.11.22)
Requirement already satisfied: requests>=2.13.0 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (2.18.4)
Requirement already satisfied: numpy in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (1.14.3)
Requirement already satisfied: murmurhash>=0.28.0 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (1.0.1)
Requirement already satisfied: thinc>=6.12.0 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (6.12.0)
Requirement already satisfied: ujson>=1.35 in d:\programdata\anaconda3\lib\site-packages (from spacy==2.0.16) (1.35)
Requirement already satisfied: msgpack>=0.5.2 in d:\programdata\anaconda3\lib\site-packages (from msgpack-numpy->spacy==2.0.16) (0.5.6)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in d:\programdata\anaconda3\lib\site-packages (from requests>=2.13.0->spacy==2.0.16) (3.0.4)
Requirement already satisfied: idna<2.7,>=2.5 in d:\programdata\anaconda3\lib\site-packages (from requests>=2.13.0->spacy==2.0.16) (2.6)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in d:\programdata\anaconda3\lib\site-packages (from requests>=2.13.0->spacy==2.0.16) (1.22)
Requirement already satisfied: certifi>=2017.4.17 in d:\programdata\anaconda3\lib\site-packages (from requests>=2.13.0->spacy==2.0.16) (2018.4.16)
Requirement already satisfied: cytoolz>=0.9.0 in d:\programdata\anaconda3\lib\site-packages (from thinc>=6.12.0->spacy==2.0.16) (0.9.0.1)
Requirement already satisfied: tqdm>=4.10.0 in d:\programdata\anaconda3\lib\site-packages (from thinc>=6.12.0->spacy==2.0.16) (4.28.1)
Requirement already satisfied: six>=1.10.0 in d:\programdata\anaconda3\lib\site-packages (from thinc>=6.12.0->spacy==2.0.16) (1.11.0)
Requirement already satisfied: wrapt>=1.10.0 in d:\programdata\anaconda3\lib\site-packages (from thinc>=6.12.0->spacy==2.0.16) (1.10.11)
Requirement already satisfied: toolz>=0.8.0 in d:\programdata\anaconda3\lib\site-packages (from cytoolz>=0.9.0->thinc>=6.12.0->spacy==2.0.16) (0.9.0)
(base) C:\Windows\system32>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import spacy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\ProgramData\Anaconda3\lib\site-packages\spacy\__init__.py", line 8, in <module>
from thinc.neural.util import prefer_gpu, require_gpu
File "D:\ProgramData\Anaconda3\lib\site-packages\thinc\neural\__init__.py", line 1, in <module>
from ._classes.model import Model
File "D:\ProgramData\Anaconda3\lib\site-packages\thinc\neural\_classes\model.py", line 11, in <module>
from .. import util
File "D:\ProgramData\Anaconda3\lib\site-packages\thinc\neural\util.py", line 3, in <module>
from preshed.maps import PreshMap
File "cymem.pxd", line 1, in init preshed.maps
ValueError: cymem.cymem.Pool has the wrong size, try recompiling. Expected 64, got 48
>>>
So I went through the same, fixed it uninstalling all spacy related packages and files then reinstalling it to version 2.0.13. You can do this by-
pip install spacy ==2.0.13
For conda i suppose doing the same with 'conda install spacy ==2.0.13' should also work.
Edit - You can do this without uninstalling spacy aswell
I am missing something, I have downloaded pgadmin4 webapp, and trying to launch it in its environnement:
(pgadmin) denis ~/anaconda3/envs/pgadmin/lib/python3.5/site-packages/pgadmin4 $ pip install flask_babel
Requirement already satisfied: flask_babel in /home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages
Requirement already satisfied: Jinja2>=2.5 in /home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages (from flask_babel)
Requirement already satisfied: Babel>=2.3 in /home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages (from flask_babel)
Requirement already satisfied: Flask in /home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages (from flask_babel)
Requirement already satisfied: markupsafe in /home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages (from Jinja2>=2.5->flask_babel)
Requirement already satisfied: pytz>=0a in /home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages (from Babel>=2.3->flask_babel)
Requirement already satisfied: itsdangerous>=0.21 in /home/denis/.local/lib/python3.5/site-packages (from Flask->flask_babel)
Requirement already satisfied: Werkzeug>=0.7 in /home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages (from Flask->flask_babel)
(pgadmin) denis ~/anaconda3/envs/pgadmin/lib/python3.5/site-packages/pgadmin4 $ sudo python pgAdmin4.py
Traceback (most recent call last):
File "pgAdmin4.py", line 34, in <module>
import config
File "/home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages/pgadmin4/config.py", line 30, in <module>
from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path
File "/home/denis/anaconda3/envs/pgadmin/lib/python3.5/site-packages/pgadmin4/pgadmin/__init__.py", line 18, in <module>
from flask_babel import Babel, gettext
ImportError: No module named flask_babel
What can I do more than source activate pgadmin and install all requirements.txt?
Running sudo python doesnt use your virtualenv. Install pgadmin reqs globally or drop sudo.