Why can't I import panda to my python file? - python

Every time I try to import pandas I get this error and I don't understand why, because I successfully installed it. Here it is:
(base) C:\Users\snin2\Documents\panda python\codigos>C:/Users/snin2/anaconda3/python.exe "c:/Users/snin2/Documents/panda python/codigos/panda1.py"
Traceback (most recent call last):
File "c:/Users/snin2/Documents/panda python/codigos/panda1.py", line 1, in <module>
import pandas as pd
File "C:\Users\snin2\anaconda3\lib\site-packages\pandas\__init__.py", line 11, in <module>
__import__(dependency)
File "C:\Users\snin2\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 140, in <module>
from . import _distributor_init
File "C:\Users\snin2\AppData\Roaming\Python\Python37\site-packages\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\snin2\anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

make sure you installed right version of anaconda python.or try to reinstall the python.
Here is the link,
if your system is 64 bit processor = https://repo.anaconda.com/archive/Anaconda3-2021.05-Windows-x86_64.exe
if 32 bit = https://repo.anaconda.com/archive/Anaconda3-2021.05-Windows-x86.exe

Related

Windows 11: xgboost Module Not Found

I am getting an error when I import xgboost
import xgboost as xgb
Traceback (most recent call last):
File "C:/Users/harsh/AppData/Roaming/JetBrains/PyCharmCE2021.2/scratches/scratch.py", line 2, in <module>
import xgboost as xgb
File "G:\My Drive\Oddsportal\venv\lib\site-packages\xgboost\__init__.py", line 9, in <module>
from .core import DMatrix, DeviceQuantileDMatrix, Booster
File "G:\My Drive\Oddsportal\venv\lib\site-packages\xgboost\core.py", line 21, in <module>
import scipy.sparse
File "G:\My Drive\Oddsportal\venv\lib\site-packages\scipy\__init__.py", line 136, in <module>
from . import _distributor_init
File "G:\My Drive\Oddsportal\venv\lib\site-packages\scipy\_distributor_init.py", line 61, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Process finished with exit code 1
When I checked, it is installed.
Installed
It was working fine and I installed/upgraded to Windows 11 and this is a new error for me.

Someone to explain to me how I can fix this problem with libraries? matplotlib

Someone know about this problem?
(Using Sublime Text)
from matplotlib import pyplot
Traceback (most recent call last):
File "C:\Users\Lorrety\Desktop\tarea9.py", line 1, in <module>
from matplotlib import pyplot
File "C:\Users\Lorrety\AppData\Roaming\Python\Python38\site-packages\matplotlib\__init__.py", line 139, in <module>
from . import cbook, rcsetup
File "C:\Users\Lorrety\AppData\Roaming\Python\Python38\site-packages\matplotlib\cbook\__init__.py", line 32, in <module>
import numpy as np
File "C:\Users\Lorrety\AppData\Roaming\Python\Python38\site-packages\numpy\__init__.py", line 138, in <module>
from . import _distributor_init
File "C:\Users\Lorrety\AppData\Roaming\Python\Python38\site-packages\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\Lorrety\AppData\Local\Programs\Python\Python38-32\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

Scapy OSError when importing scapy.all: 'wpcap.dll' does not exsist

I tried to import scapy.all, but an error saying 'wpcap.dll' does not exist. Why does this happen? I am sure I downloaded everything correctly. I saved everything into a folder called scapy . I got an OSError from module ctypes. Does Python expect me to have something pre-installed?
This is my error (I used scapy.scapy.all since I saved it into a folder)
>>> import scapy.scapy.all
WARNING: Windows support for scapy3k is currently in testing. Sniffing/sending/receiving packets should be working with WinPcap driver and Powershell. Create issues at https://github.com/phaethon/scapy
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
import scapy.scapy.all
File "C:\Python34\scapy\scapy\all.py", line 16, in <module>
from .arch import *
File "C:\Python34\scapy\scapy\arch\__init__.py", line 88, in <module>
from .windows import *
File "C:\Python34\scapy\scapy\arch\windows\__init__.py", line 23, in <module>
from scapy.scapy.arch import pcapdnet
File "C:\Python34\scapy\scapy\arch\pcapdnet.py", line 32, in <module>
from .winpcapy import *
File "C:\Python34\scapy\scapy\arch\winpcapy.py", line 26, in <module>
_lib=CDLL('wpcap.dll')
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
>>>
Make sure you have WinPcap installed in order to use scapy.

Ssh Python Module Gives Error When Trying To Import

I've been trying to figure out how to ssh using python 2.7 on a 64-bit Windows 8 computer. I found a module called ssh, so I used pip to install it. But when I type,
>>> import ssh
It gives me this error,
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import ssh
File "C:\Python27\lib\site-packages\ssh\__init__.py", line 62, in <module>
from transport import SecurityOptions, Transport
File "C:\Python27\lib\site-packages\ssh\transport.py", line 33, in <module>
from ssh import util
File "C:\Python27\lib\site-packages\ssh\util.py", line 33, in <module>
from ssh.common import *
File "C:\Python27\lib\site-packages\ssh\common.py", line 98, in <module>
from Crypto import Random
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\__init__.py", line 28, in <module>
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\__init__.py", line 34, in <module>
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\nt.py", line 28, in <module>
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\winrandom.py", line 7, in <module>
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\winrandom.py", line 6, in __bootstrap__
ImportError: DLL load failed: %1 is not a valid Win32 application.
I'm not sure what it means. Did I install it correctly? How do I fix this? Are there any alternatives? I would appreciate your help very much.

How to install AntTweakbar on Ubuntu 14.04?

I followed the instructions for how to install the AntTweakBar python module which I found on the AntTweakBar website (http://anttweakbar.sourceforge.net/doc/tools:anttweakbar:download)
When I try to run my code which uses this library, I get the following error:
Traceback (most recent call last):
File "main.py", line 80, in <module>
from eye import eye
File "/home/phil/pupil-master/pupil_src/capture/eye.py", line 17, in <module>
import atb
File "/home/phil/pupil-master/pupil_src/shared_modules/atb/__init__.py", line 16, in <module>
from raw import *
File "/home/phil/pupil-master/pupil_src/shared_modules/atb/raw.py", line 39, in <module>
__dll__ = ctypes.CDLL(dll_path)
File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libAntTweakBar.so.1: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE
So I added a symbolic link from the AntTweakBar/src to a directory in my pupil path using
ln -s pwd /usr/lib/python2.7/dist-packages
Thanks!
Edit: I'm using ctypes.

Categories

Resources