How to install missing wx module on Python 2.5? - python

I have developped a tool under python 2.5 and can't upgrade to a newer python version as I need to use an API developped under python 2.5 as well.
I recently tried my tool under another machine and it seems it hasn't wx module installed as you can see below:
>>> import wx
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
ImportError: No module named wx
So I searched for the wxpython source. However once I tried to install the source with:
D:\tmp\wxPython-4.0.0b2>c:\Python25\python.exe setup.py install
I got following error:
Traceback (most recent call last): File "setup.py", line 15, in
from setuptools import setup, find_packages ImportError: No module named setuptools
I can't either install whl files as I don't have pip.
So, how can I install wxpython for python 2.5 under Windows?
Is there any executable there in the web that I couldn't find? May there be a workaround by copying the wx module from a python directory from another computer?

As I had to install wxpython 2.7.2.0 I finally got it from wxPython2.7-win32-ansi-2.7.2.0-py25.exe.
As stated in Patrick's comment all wxpython executables for any version are under https://sourceforge.net/projects/wxpython/files/wxPython/

Related

Where does Cygwin64 store/look for Python packages?

I'm trying to use Cygwin64 to run a python script, but it's not working because for some reason it can't find the module.
Traceback (most recent call last):
File "makeplot.py", line 1, in <module>
import vplanet
ModuleNotFoundError: No module named 'vplanet'
Where are modules installed in Cygwin64 and How do I make sure my module is installed?
It seems you are expecting that Cygwin version of Python should contain any type of module around.
If you look for vplanet, you will find the specific instruction for installation
https://virtualplanetarylaboratory.github.io/vplanet/install.html
python -m pip install vplanet
Have you tried it ?

No module named '_gdbm'

I don't know much about python and I need help to install a python software.
I am using linux mint 12.8.
Since I have tried many things I think I have several versions of python installed (3.5 and 3.7 I think...).
When I run setup.py install I get:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
import dbm.gnu as gdbm
File "/home/zach/10_Soft/anaconda3/lib/python3.7/dbm/gnu.py", line 3, in <module>
from _gdbm import *
ModuleNotFoundError: No module named '_gdbm'
I tried to install python3.5-gdbm (which appears to be up to date) and python3.7-gdbm (which is not found).
They both seem to be virtual packages of the same package python3-gdbm. I don't really know what to do with this information however...
Do you know what I should do?
I was able to solve this issue using this command:
sudo cp /usr/lib/python3.5/lib-dynload/_gdbm.cpython-35m-x86_64-linux-gnu.so /usr/lib/python3.7/lib-dynload/_gdbm.cpython-37m-x86_64-linux-gnu.so

Error "No module named wxversion" when launching playonlinux

I am currently on GNOME and trying to run playonlinux but unfortunately, when I try to launch it, I get this :
"Looking for python... 2.7.11 - Traceback (most recent call last):
File "/usr/share/playonlinux/python/check_python.py", line 1, in <module>
import os, wxversion
ImportError: **No module named wxversion**
failed tests
Looking for python2.7... 2.7.11 - Traceback (most recent call last):
File "/usr/share/playonlinux/python/check_python.py", line 1, in <module>
import os, wxversion
ImportError: **No module named wxversion**
failed tests
Looking for python2.6...
Looking for python2... 2.7.11 - Traceback (most recent call last):
File "/usr/share/playonlinux/python/check_python.py", line 1, in <module>
import os, wxversion
ImportError: **No module named wxversion**
failed tests
Please install python before trying to run this program"
I tried to reinstall Python and Playonlinux but it did not work.
I have python-wxgtk3.0 already installed but when I list all the python packages I have with a little python script, it does not appear ...
My version of Python is 2.7.11.
Does someone know what I can do please ?
Thank you,
Rayan
You can refer this How to install wxPython
Using pip install wxPython-Phoenix (Linux):
sudo pip install --upgrade --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython
OR this SO Post
python-wxversion is available as a separate package.
Use synaptic or apt to install it.
sudo apt show python-wxversion
Package: python-wxversion
Version: 3.0.2.0+dfsg-1build1
Priority: optional
Section: universe/python
Source: wxpython3.0
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
Original-Maintainer: wxWidgets Maintainers <freewx-maint#lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 64.5 kB
Depends: python:any (<< 2.8), python:any (>= 2.7.5-5~)
Homepage: http://wxpython.org/
Task: edubuntu-desktop-gnome, ubuntustudio-photography
Supported: 9m
Download-Size: 12.7 kB
APT-Manual-Installed: no
APT-Sources: http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Description: API for selecting the wxPython version to use
wxWidgets (formerly known as wxWindows) is a class library for C++ providing
GUI components and other facilities on several popular platforms (and some
unpopular ones as well).
.
This package provides the wxPython version selector.
In the most recent version of wxPython (4.0.1 as I write this), wxversion is deprecated. See https://docs.wxpython.org/MigrationGuide.html#the-wxversion-module
Just remove the wxversion import, or replace with wx, as I imagine it was just checking the version of wxPython before importing it.

Mac reinstall Python

I tried to use the Coursera course downloader from here and it worked for few courses but not all. They have recommended to use Python3.X. So I uninstalled Anaconda (version 2) from my Mac and installed Python3.5.1 from Python's website but still the course downloaders did not work as it was using default Python 2.7.
So I deleted Python from /usr/local/lib and now nothing is working. When I do which python it shows ``usr/local/bin/pythonand bothpythonandpython3` runs.
But when I do pip install coursera it throws error as follows:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
And when I do sudo easy_install pip, I get the following error.
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
try Homebrew http://brew.sh/
brew install python3
curl bootstrap.pypa.io/get-pip.py | python3
Your Mac should have Python 2 and Python 3 installed by default. in the terminal "python" will launch Python2, "python3" will launch Python3. With Anaconda you could have just kept the Python 2 version and created an environment for Python 3, http://conda.pydata.org/docs/using/envs.html#managing-environments.
This is the solution you will most likely need, No module named pkg_resources. Setuptools is causing the issue and you will need to wget ez_setup.py. Reinstalling Anaconda will save you a lot of time and pain.

I'm installing cortex and am receiving a python 'configparser' error when running the main file

I've cloned the cortex repo and change the python path in the main file from:
#!/usr/bin/env python3
to
#!/usr/bin/python2.7
Which is what I'm running.
However, on running the application I get the below
cortex$ ./cortex pirateparty
Traceback (most recent call last):
File "./cortex", line 10, in <module>
from configparser import ConfigParser
ImportError: No module named configparser
Re-reading the above, I suspect I need to install python 3. Is this the case?
You need to install configparser library which you probably dont have in your other python enviorment, run:
pip install configparser

Categories