I have some issues with Anaconda3 on windows 10 64bit
Installing version Anaconda3-2019.07-Windows-x86_64 and launching python on the command line (anaconda prompt) the following message appears :
(base) C:\>python
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
It's actually a 64bit version but the message above displays " Anaconda, Inc. on win32". which is strange...
And then, when the ssl module is imported the following error appears :
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\u00178980\anaconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: %1 not a valid Win32 application.
It seems that there is some mixing out of 64 and 32 bit versions?
Related
(test_pytorch) C:\Users\kuntal chowdhury>python
Python 3.8.3 (default, May 19 2020, 06:50:17) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
import torch
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\kuntal chowdhury\Anaconda3\envs\test_pytorch\lib\site-packages\torch__init__.py", line 81, in
ctypes.CDLL(dll)
File "C:\Users\kuntal chowdhury\Anaconda3\envs\test_pytorch\lib\ctypes__init__.py", line 373, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\kuntal chowdhury\Anaconda3\envs\test_pytorch\lib\site-packages\torch\lib\caffe2_nvrtc.dll' (or one of its dependencies). Try using the full path with constructor syntax.
See this answer here
TL;DR, I suspect you are trying to run torch from an environment that does not have CUDA installed. Thus, you must install the cpu version of torch:
conda install pytorch torchvision cpuonly -c pytorch
Information:
OS: Windows 8.1 64-bit
Python: 3.7.3 64-bit
Anaconda: 64-bit
Agenda:
To make sure python -c "import torch" works without any errors.
Process:
I have created my environment using conda create -n myenv
After which with great difficulty I have further installed conda install pytorch torchvision cudatoolkit -c pytorch
When the above command was executed, it was interrupted midway due to HTTPRequest failure
After several such failures, I have installed pytorch using conda install pytorch -c pytorch
When I type python -c "import torch" I get OSError like the one below
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\sanpj\.conda\envs\myenv\lib\site-packages\torch\__init__.py", line 42, in <module>
import numpy as _np # noqa: F401
File "C:\Users\sanpj\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\sanpj\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 23, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\sanpj\.conda\envs\myenv\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
But the output should not be as such.
When I type in python, I get some information as mentioned below
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
Solved it!
Actually, I downgraded to older versions of torch, torchvision & numpy as well.
That actually solved this issue.
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've been trying to run a colleague's script and though I have pandas running now, tkinter fails to load for some reason:
D:\>python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\lib\tkinter\__init__.py", line 36, in <module>
from tkinter import _fix
File "C:\Python34\lib\tkinter\_fix.py", line 65, in <module>
import _tkinter
ImportError: DLL load failed: %1 is not a valid Win32 application.
I was under the impression tkinter shipped with Python 3.4?
My computer is a 64-bit machine running Windows 7 if that makes a difference?
I am having a problem with "import "serial".
I am running Python 3.3.2 on Windows (XP) and have installed pyserial 2.5 from the Windows installer pyserial-2.5.win32.exe. The traceback below shows what happens.
C:\hal\Python>python
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\python33\lib\site-packages\serial\__init__.py", line 19, in <module>
from serialwin32 import *
ImportError: No module named 'serialwin32'
>>>
The python interpreter finds and runs c:\python33\lib\site-packages\serial\ __init__.py, which checks the os name, finds that it is "nt" and executes "from serialwin32 import *". That fails.
The file serialwin32.py is in the \serial directory with __init__.py.
I tried this with Python 3.1.1 and 3.2.3 and got the same results.
I read that pyserial 2.5 is not dependent on pywin32 but I have it installed anyway; win32, build 18, for Python 3.3.
Has anyone seen this problem or know what I may be doing wrong?
Thanks