Error when executing Canopy's Pythonwin.exe (wincon32 module not found) - enthought

I'm sorry if my title doesn't make sense but that's the problem I'm having.
When executing a script at the command line, (or by double-clicking on it) using C:\pythonwin.exe SomeApp.pyw, I get a popup error box saying
ImportError: No module named wincon32. (Full error message at the bottom)
Just executing pythonwin.exe by itself with or without a script also has the same effect.
Google is amazingly bereft of any knowledge of wincon32. Trying to install wincon32 module with pip install wincon32 just says "Could not find a version that satisfies the requirement wincon32 (from version: ) No matching distribution found for wincon32"
pythonwin.exe is in the system's PATH.
Thanks for any help. Below is the full contents of the popup error box.
Title - Python Traceback
Traceback (most recent call last):
File "string", Line 1 in module
File "C:\Users\Me\Canopy(Python)\User\Lib\site-packages\pythonwin\pywin
\framework\startup.py", line 49, in _import_(moduleName)
File "C:\Users\Me\Canopy(Python)\User\Lib\site-packages\pythonwin\pywin
\framework\intpyapp.py", line 3, in import wincon32
ImportError: No module named wincon32
(I'm using Windows 10 x64)

Where did c:\Pythonwin.exe come from? It's not part of any Canopy installation that I've ever heard of. If you're trying to run Canopy Python, see https://support.enthought.com/entries/23646538-Make-Canopy-User-Python-be-your-default-Python

Related

AttributeError: module 'pypandoc' has no attribute 'convert'

I am trying to switch a python project over to poetry & pyproject.toml. Previously, we were using requirements.txt.
When I try to install pyspark 2.4.8 with poetry, however, I hit this error:
File "<string>", line 156, in <module>
AttributeError: module 'pypandoc' has no attribute 'convert'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Has anyone run into this? Do you know why this is an issue with poetry but not with requirements.txt?
it seems you need to downgrade it since 'convert' was removed in the 1.8 version.
https://github.com/man-group/pytest-plugins/issues/87

PyCUDA -- problems importing pycuda.driver

Windows 10
Python 3.8
CUDA 11.5
I've installed what I believe to be a matching pycuda from this file:
pycuda-2021.1+cuda115-cp38-cp38-win_amd64.whl
This simple example fails
import pycuda.driver as drv
drv.init()
print("Detected {} CUDA devices".format(drv.Device.count()))
With this error:
Traceback (most recent call last):
File "C:/University of Arizona/weeds/tests/cuda-summary.py", line 5, in <module>
import pycuda.driver as drv
File "C:\Users\evan\AppData\Local\Programs\Python\Python38\lib\site-packages\pycuda\driver.py", line 65, in <module>
from pycuda._driver import * # noqa
ImportError: DLL load failed while importing _driver: The specified procedure could not be found.
NVCC is in my path
Adding os.add_dll_directory(os.path.join(os.environ['CUDA_PATH'], 'bin')) has no effect
The script works just fine on my Jetson Nano
Any ideas on how to get past this? I've searched and tried several solutions.
It is quite strange, but updating the Nvidia display driver fixed the issue for me.
But in my case there was no issue on my PC with the same versions of Windows, Python, CUDA and PyCuda. The issue appeared on the different Windows 10 machine, when launching the exe, packaged by PyInstaller. So, updating the display driver was the fix for this machine.

pySerial installed, but still getting ImportError

I am new to Python, so I have likely done something obviously wrong, though despite my best efforts I cannot figure out what.
I am running windows 7 64bit.
I only have Python 3.5 (32 bit) installed.
I updated pip to the latest version succesfully and used it to install pySerial. I am working in eclipse oxygen with PyDev installed. My run configuration does show the appropriate path (as far as I can tell):
run configuration in eclipse/PyDev
I have confirmed pySerial is installed by doing the following in python interpreter:
>>>help()
>>>modules
serial shows up in the list of modules.
also:
>>> import serial; print(serial.__file__)
C:\Python35\lib\site-packages\serial\__init__.py
Additionally, trying to use serial in the terminal works fine, as below:
>>> import serial
>>> s=serial.Serial("COM4")
>>> s
Serial<id=0x383b750, open=True>(port='COM4', baudrate=9600, bytesize=8, parity='N', stop
bits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)
However, when I try to run the following code as a file:
import serial
print ("Test Script")
I get the following error:
Traceback (most recent call last):
File "C:\Users\H260643\Desktop\Projects\EclipseWorkspace\CMP_Thous_Hr\Base.py", line 1, in <module>
import serial
ImportError: No module named 'serial'
For what it's worth, the eclispe editor window has also flagged that line saying it is an "unresolved import: serial"
Right after posting this I realized that the install path for python/pySerial did not match what was in my eclispe/PyDev run configuration. I corrected my run configuration and all is well.

Vpython not working after update

I'm using ubuntu 16.04 and python files that were using vpython that were working fine before now crash showing
from visual import *
ImportError: No module named visual.
I installed anaconda, still nothing. I launched jupyter notebook on the terminal, it opens on a new window in google chrome. I created a test.py file containing just
import vpython
and it prompts:
Traceback (most recent call last):
File "teste vpython.py", line 1, in <module>
import vpython
File "/home/user/anaconda2/lib/python2.7/site-
packages/vpython/__init__.py", line 10, in <module>
from .vpython import *
File "/home/user/anaconda2/lib/python2.7/site-
packages/vpython/vpython.py", line 507, in <module>
get_ipython().kernel.comm_manager.register_target('glow', GlowWidget)
AttributeError: 'NoneType' object has no attribute 'kernel'
I would appreciate if somebody could help me. I know there are similar tags, but I did as every answer I checked as suggested with no results.
Thank you.
I have Ubuntu 16.04 with Anaconda and Python 3.6. Just now I created another environment that contains Python 2.7. In that environment I did "pip install vpython --upgrade" and verified with "pip show vpython" that the version is indeed 7.0.3. I then executed "jupyter notebook" and demo programs ran fine.
I am puzzled by your comment that you created a test.py file, and by the line that says "File "teste vpython.py", line 1, in ". I would expect a file with the .ipynb extension, so something doesn't seem right.
I'll advertise that a better place to pose VPython questions is in the VPython forum at
https://groups.google.com/forum/?fromgroups&hl=en#!forum/vpython-users

Import error: libjpeg.so.7: cannot open shared object file: No such file or directory

I install the academic Enthought Cannopy on Redhat. When I type in
import _imaging
It print out the error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libjpeg.so.7: cannot open shared object file: No such file or directory
But on the Enthough website, it was said that the libjpeg has been included.
The Canopy's version is 1.1.0. The output of env in terminal is:
MANPATH=/opt/torque/man:/usr/NX/bin:/usr/kerberos/bin:/usr/java/latest/bin:/share/apps/anaconda/bin:/usr/local/bin:/bin:/usr/bin:/opt/bio/ncbi/bin:/opt/bio/mpiblast/bin/:/opt/bio/hmmer/bin:/opt/bio/EMBOSS/bin:/opt/bio/clustalw/bin:/opt/bio/tcoffee/bin:/opt/bio/phylip/exe:/opt/bio/mrbayes:/opt/bio/fasta:/opt/bio/glimmer/bin://opt/bio/glimmer/scripts:/opt/bio/gromacs/bin:/opt/bio/gmap/bin:/opt/bio/tigr/bin:/opt/bio/autodocksuite/bin:/opt/ganglia/bin:/opt/ganglia/sbin:/opt/openmpi/bin/:/opt/maui/bin:/opt/torque/bin:/opt/torque/sbin
BIOROLL=/opt/bio
TERM=xterm-256color
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=141.211.38.9 36340 22
PHENIX_INSTALLER_DATE=300920111225
ROCKSROOT=/opt/rocks/share/devel
PHENIX_MVERSION=redhat-e5.4
PHENIX=/share/apps/phenix-1.7.2-869
SSH_TTY=/dev/pts/8
ANT_HOME=/opt/rocks
USER=xqding
PHENIX_MTYPE=intel-linux-2.6-x86_64
LS_COLORS=
ROCKS_ROOT=/opt/rocks
VIRTUAL_ENV=/home/xq/Enthought/Canopy_64bit/User
MAIL=/var/spool/mail/xq
PATH=/home/xqding/Enthought/Canopy_64bit/User/bin:/home/xq/Enthought/Canopy_64bit/User/bin:/home/xq/apps/bin:/share/apps/phenix-1.7.2-869/build/intel-linux-2.6-x86_64/bin:/library/yzhang/bin/HMMER:/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/X11R6/bin:/tmp/updates/rocks/bin:/tmp/updates/usr/sbin:/tmp/updates/sbin:/tmp/updates/usr/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/sun-ct/bin:/home/xq/apps/cd-hit-v4.6.1-2012-08-27:/home/xq/apps/samtools-0.1.19:/library/blast/bin:/home/xq/apps/cd-hit-v4.6-2012-04-25:/home/xq/apps/dssp-2.2.1:/home/xqding/apps/dssp-ver2hor:/home/xq/bin:/home/xq/apps/python/2.7/bin
NXDIR=/usr/NX
INPUTRC=/etc/inputrc
PWD=/home/xqding/appsrc
JAVA_HOME=/usr/java/latest
EDITOR=emacsclient
LANG=en_US.iso885915
PHENIX_USE_MTYPE=intel-linux-2.6-x86_64
PHENIX_ENVIRONMENT=1
BLASTDB=/home/xqding/bio/ncbi/db
PHENIX_VERSION=1.7.2
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
PHENIX_RELEASE_TAG=869
SHLVL=1
HOME=/home/xq
ROLLSROOT=/opt/rocks/share/devel/src/roll
LOGNAME=xqding
CVS_RSH=ssh
LESSOPEN=|/usr/bin/lesspipe.sh %s
BLASTMAT=/opt/bio/ncbi/data
G_BROKEN_FILENAMES=1
_=/usr/bin/env
I download the source code of libjpeg version 7 and install it on the Redhat computer. Then add the library directory to the export LD_LIBRARY_PATH=directory of libjpeg. Then the problem is solved. I appreciate the help I got from here. So I just add the solution.
It's possible that the libjpeg version installed with your RedHat is outdated (are you on RedHat 5?). Try and open the RedHat package manager and look for "jpeg". Installing a later version of the library might fix this issue.