I had download pandas from this link
Then I unzipped the pandas file in site-packages and run the python setup.py command.
import pandas work fine in the directory where it is installed
C:\Python27\ArcGIS10.3\Lib\site-packages\pandas-0.17.1>python
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>>
Once am out of the directory pandas-0.17.1, import pandas gives following results:
C:\Python27\ArcGIS10.3\Lib\site-packages>python
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32
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 is it so?
you should add PYTHONPATH in your shell like this on windows.
set PYTHONPATH=%PYTHONPATH%;C:\Python27\ArcGIS10.3\Lib\site-packages\pandas-0.17.1
Related
I have an Ubuntu machine (18.04) on a VM. When I run python in the home directory, everthing responds normally, however when I run from a sub directory it is failing to import modules in the standard library.
The sequence below illustrates the problem
anon#anon-VirtualBox:~$ python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>import os
>>> os.environ['PATH']
'/bin:/home/anon/anaconda2/bin:/home/anon/bin:/home/anon/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
>>> import logging
>>> exit()
Which is the expected behaviour.
However when I go into a subdirectory, the same operation fails
anon#anon-VirtualBox:~$ cd GitHub/bikeano
anon#anon-VirtualBox:~/GitHub/bikeano$ python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['PATH']
'/bin:/home/anon/anaconda2/bin:/home/anon/bin:/home/anon/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
>>> import logging
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "logging.py", line 5, in <module>
import logging.handlers
ImportError: No module named handlers
>>>
I do not understand what is happening here. Are there other environment variables which could affect this?
Also, this is occuring on a Virtualbox VM, and the same .vdi works normally on another machine? The host is Windows 10 on both machines.
I've installed wine on Ubuntu, python2.7 and pyqt4 install. But when I try to import pyqt4, it shows the error :
john#Ubuntu-python:~/.wine$ wine python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.QtCore import *
err:module:import_dll Library python34.dll (which is needed by L"C:\\Python27\\lib\\site-packages\\PyQt4\\QtCore.pyd") not found
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: Module not found.
I am trying to use the module inspect in two different environments. In one of the environments, everything is fine. In the other, inspect appears to be missing the function getcallargs. I am not sure what's going wrong. I'm also not sure how to check the version of inspect that is being used in each environment. How can I get inspect to work in the problematic environment?
The environment that works fine is as follows:
user1#computer1:~>python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> print inspect.getcallargs
<function getcallargs at 0x7ff122c0a578>
The environment that breaks is as follows:
(virtual_environment)-bash-4.1$ python
Python 2.6.6 (r266:84292, Jan 23 2014, 10:39:35)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> print inspect.getcallargs
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getcallargs'
In Python 2.6 the inspect module does not have the getcallargs function.
https://docs.python.org/release/2.6/library/inspect.html
Python 2.7 does have getcallargs
https://docs.python.org/2/library/inspect.html
It runs on windows 8.1 64 bit machine, I have installed python 2.7.8 and numpy 1.5.1 (earlier had 1.9.1) and openCV 2.4.10. I got this error referred other blogspots, stackoverflow previous questions but couldn't get the right results. I think it has something to do with 64/32 bit version compatibility please help me out!!!
command line:
C:\Users\Shivakumar>python
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win 32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>
I have Python version 2.7 installed in my system, which is Windows OS 64 bit.
I installed pyserial, from the page: https://pypi.python.org/pypi/pyserial
Now, the issue is that I am getting an error:
C:\rk\Python27\pythonprograms>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (I
32
Type "help", "copyright", "credits" or "license" for more informati
>>> import serial
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\rk\Python27\lib\site-packages\serial\__init__.py", line
e>
from serial.serialwin32 import *
File "C:\rk\Python27\lib\site-packages\serial\serialwin32.py", li
dule>
import ctypes
File "C:\rk\Python27\lib\ctypes\__init__.py", line 10, in <module
from _ctypes import Union, Structure, Array
ImportError: DLL load failed: %1 is not a valid Win32 application.
When I import other packages, they are getting imported successfully:
>>> import numpy
>>>
Also, if I import pyserial in the directory "C:\rk\Python27\python":
C:\rk\Python27>python
Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>>
What's the reason and how to fix this issue?
Kindly help, Thanks.
Issue resolved.
I was opening Python exe as the 32 bit one, where as I had installed Python 2.7 for 64 bit with an amd extension.
I installed the python version recently, but, forgot to change the old compiler.