After installing pandas am able to import in cmd as below :
C:\Users\me\Desktop\Django_Project>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>>
But when am importing pandas in Spyder in IPython 6.5.0 console I get below error:
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 6.5.0 -- An enhanced Interactive Python.
c:\program files (x86)\python37-32\lib\site-packages\ipykernel\parentpoller.py:116: UserWarning: Parent poll failed. If the frontend dies,
the kernel may be left running. Please let us know
about your system (bitness, Python, etc.) at
ipython-dev#scipy.org
ipython-dev#scipy.org""")
In [1] : import pandas
Traceback (most recent call last):
File "<ipython-input-1-38d4b0363d82>", line 1, in <module>
import pandas
ModuleNotFoundError: No module named 'pandas'
In [2] :
Note: I have installed python in "C:\Users\me\AppData\Local\Programs\Python\Python37\" path and environment variables is set as "C:\Users\me\AppData\Local\Programs\Python\Python37;"
And I installed pandas using PIP
Please suggest the solution to resolve this issue.I have tried reinstalling the pandas package almost 6-7 times.
I think you should open anaconda command prompt by searching it in windows search bar . Now write there "conda install -c anaconda pandas" and try again to run the program
Related
I am using python3 and have installed tensorflow-gpu using:
pip3 install tensorflow-gpu==1.13.1
And have checked that it is installed by:
pip3 show tensorflow-gpu
Name: tensorflow-gpu
Version: 1.13.1
Summary: TensorFlow is an open source machine learning framework for
everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource#google.com
License: Apache 2.0
Location: /usr/lib64/python3.6/site-packages
Requires: tensorflow-estimator, keras-applications, termcolor, absl-py, six,
astor, protobuf, wheel, keras-preprocessing, gast, grpcio, numpy,
tensorboard
Required-by:
but when I do the following it gives me an error:
user:/home/mydirectory # python3
Python 3.6.5 (default, Mar 31 2018, 19:45:04) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/tensorflow/__init__.py", line 24,
in <module>
from tensorflow.python import pywrap_tensorflow # pylint:
disable=unused-import
File "/usr/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 25, in <module>
from tensorflow.python.platform import self_check
ModuleNotFoundError: No module named 'tensorflow.python.platform'
I see from the error that its looking for tensorflow in directory
/usr/lib/python3.6/site-packages/tensorflow
But pip indicates that its installed at
/usr/lib64/python3.6/site-packages
How can I fix this issue?
Please follow below steps..
0) please login with root permission or sudo and write this command in terminal
1)pip3 install tensorflow-gpu==1.13.1
2)pip3 --version
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
3)shekh#shekh:~$ python3
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
https://www.tensorflow.org/install/pip
See https://github.com/tensorflow/tensorflow/issues/374
Are you opening the terminal from within the tensorflow directory?
"Actually I had this issue because I was trying to import tensorflow from a python session inside the tensorflow repo folder, going to some other folder and starting python and importing tensorflow worked for me."
I also had this error and it was solved with this command
python2:
PYTHONPATH="${PYTHONPATH}:/usr/local/lib/python2.7/dist-packages/"
export PYTHONPATH
python3:
PYTHONPATH="${PYTHONPATH}:/usr/local/lib/python3.6/dist-packages/"
export PYTHONPATH
I encountered a similar error on a Windows 10 system.
There, I had a second tensorflow install under AppData\Roaming\Python\.... This install was likely a product of some previous work that I did not clean up properly, so for me, removing the content of the site-packages directory solved the issue. After that I could import tensorflow without any problems.
When trying to install pgadmin4 in desktop mode on my Ubuntu system, I received a ModuleNotFoundError for _ctypes.
I did some research and found that _ctypes requires the libffi-dev package to be installed. However it seems that libffi-dev and thus _ctypes was installed for Python 2.7, when I run import ctypes it seems to work:
$ python2
Python 2.7.15+ (default, Nov 27 2018, 23:36:35)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>>
When I try to do the same for Python 3.7, it doesn't work:
$ python
Python 3.7.3 (default, Jun 21 2019, 12:46:58)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
How could I add the module _ctypes to my Python 3.7 configuration?
If you install python from source file, you have to install some required packages manually as mentioned in https://superuser.com/questions/1412975/how-to-build-and-install-python-3-7-x-from-source-on-debian-9-8.
Actually you are supposed to see some errors after make due to libffinot found as shown in the screenshot below. However, you can still run make install despite the error. When you open python after the installation and import the module, it then gives you such error.
To solve this problem, you can install the dependent package i.e libffi or libffi-devel(redhat) prior to ./configure, make and make install as mentioned in:
Package libffi was not found in the pkg-config search path REDHAT6.5 and
https://bugs.python.org/issue31652.
I have installed graph-tool:
brew --prefix graph-tool
'/usr/local/opt/graph-tool
but when trying to import it:
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from graph_tool.all import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'graph_tool'
:(
Does anyone have a solution for this?
Thanks
Homebrew installs the library using its own Python interpreter, which has its module path somewhere in /usr/local/opt/. You are using the anaconda Python interpreter, which knows nothing about homebrew-installed modules. The solution here is simply to use homebrew's Python interpreter, not anaconda's.
I'm using Python 3.6.4 with pillow 5.0.0, through Anaconda.
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "F:\Anaconda2\envs\py3\lib\site-packages\PIL\Image.py", line 58, in <module>
from . import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
Probably the same as this question. But that was 10 months ago and the answer says it was fixed with Python 3.6.1.
If you're using the Anaconda distribution, try removing it with Conda:
conda uninstall pillow
and installing it using pip:
pip install pillow
You can test that it's working:
python -c "from PIL import Image"
I have installed pandas with command 'pip3.4 install pandas'.
Successfully installed pandas python-dateutil pytz numpy six
Cleaning up...
root#hwy:~# python3.4
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'pandas'
Why can't import pandas in python3.4 after pandas been installed successfully?
root#hwy:/home/debian8# pip3.4 show pandas
---
Name: pandas
Version: 0.17.1
Location: /usr/local/python3.4/lib/python3.4/site-packages
Requires: python-dateutil, pytz, numpy
root#hwy:/home/debian8# echo "import sys; print sys.path"
import sys; print sys.path
root#hwy:/home/debian8# python3.4
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu',
'/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages',
'/usr/lib/python3/dist-packages']
Your pandas is installed here:
/usr/local/python3.4/lib/python3.4/site-packages
But this path is not in sys.path.
As a workaround do:
export PYTHONPATH=$PYTHONPATH:/usr/local/python3.4/lib/python3.4/site-packages
and inside this terminal start Python again and do your import of pandas.
If this works, add this line above (export PYTHONPATH...) to your ~/.bashrc or equivalent if you use a different shell for a more permanent solution.