Trying to install J3DView - python

After entering the following in the command line:
sudo apt-get install python3 python3-dev python3-pip
sudo pip3 install cx_Freeze Cython PyOpenGL PyOpenGL_accelerate
sudo python3 setup.py install_exe
The last command gives me this error:
Could not import cx_Freeze. Building executable not possible.
Traceback (most recent call last):
File "setup.py", line 13, in <module>
from Cython.Build import cythonize
ImportError: No module named 'Cython'
Any ideas why?
I'm using Linux Mint 17.3 'Rosa' Cinnamon 64-bit.
[EDIT]
This problem was a complete mess and I still have no clue what happened before. I have given up trying to get Python to work, as I have found an application that does the same thing as the Python application I was trying to get working. It's such a pain.

Related

Cannot uninstall python/pip on raspberry pi 3 b+

I am working on a raspberry pi 3B+. I want to upgrade the python from 2.7 to 3.6.
I downloaded the python 3.6 extracted and made it, However it got installed in the /usr/local/bin.
I tried to make it again this time by specifying ./configure --prefix=/usr prefix however the make gave a traceback error.
I also tried update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2 which helps in changing versions of python.
However, after doing so, my pip is not working now.
I have the following files in /usr/local/bin:pip,pip2.7,pip3,pip3.5,pip3.6.
I tried removing pip so that i can reinstall it using sudo apt-get remove python-pip but it gives the following error:
pi#raspberrypi:/usr/local/bin $ sudo apt-get remove python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libpython-all-dev python-all python-all-dev python-keyring
python-keyrings.alt python-secretstorage python-wheel
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
python-pip
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
1 not fully installed or removed.
After this operation, 671 kB disk space will be freed.
Do you want to continue? [Y/n] y
Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 29, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
(Reading database ... 138007 files and directories currently installed.)
Removing python-pip (9.0.1-2+rpt2) ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: error processing package python-pip (--remove):
subprocess installed pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python-pip
E: Sub-process /usr/bin/dpkg returned an error code (1)
which suggests that apt_pkg (or some problem with apt-get).
when i do pip --version , i get:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
I just want to have python 3.6 and 2.7(since i have already installed libraries on 2.7) with functional pip.
Why don't you install miniconda for ARM and get Python and all important packages at once ?
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
sudo md5sum Miniconda3-latest-Linux-armv7l.sh
sudo /bin/bash Miniconda3-latest-Linux-armv7l.sh
sudo reboot -h now
I think you aren't aware that most linux distros come shipped with python2 AND python3. By typing python and pip you will use your operating systems python2 and pip2 version.
What you probably want is using python3 and pip3 instead.
Something like "upgrading" from python2 to python3 is not possible because it's a fundamental difference and they are incompatible. This is why you have both installed.
Uninstalling or upgrading your systems python interpreter is a terrible bad idea, because your system needs them. For professional usage you should think about version control again, but for your first (and second) steps in python it's totally fine to use the preinstalled python interpreter of your OS.
Solutions like pyenv or virtualenv are very powerfull tools, but you probably don't want to start with it.

Trouble installing Adafruit's DHT11 Python library

I followed these instructions to install the Adafruit DHT11 library (https://github.com/adafruit/Adafruit_Python_DHT):
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
sudo apt-get install build-essential python-dev
sudo python setup.py install
And I found the library installed under /home/pi (I'm working with a Raspberry Pi 3). The file I want to fun is in /home/pi/Desktop so I move the library into that directory. However, I still can't run my python file properly. This is the error I'm getting:
Traceback (most recent call last):
File "sensorRead.py", line 4, in <module>
import Adafruit_DHT
ImportError: No module named 'Adafruit_DHT'
How do I get rid of this error? And where should I move my file (or the library) so the library will work? Thank you.
I fixed it. I moved my file into Adafruit_Python_DHT/examples and ran it with the python sensorRead.py command. To be honest, I don't know why it works when I put it into examples, but it does.

How to install pyatspi?

I'm using ldtp and while I import it ,my idle jump out with a error:
from ldtp import *
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/ldtpd/__init__.py", line 38, in <module>
from xmlrpc_daemon import XMLRPCLdtpd
File "/usr/local/lib/python2.7/site-packages/ldtpd/xmlrpc_daemon.py",line 25, in <module>
import core
File "/usr/local/lib/python2.7/site-packages/ldtpd/core.py", line 24, in <module>
from pyatspi import findDescendant, Registry
ImportError: No module named pyatspi
And then I yum install pyatspi but found
No package pyatspi available.
Then I download pyatspi-2.20.0.tar.xz
During ./configure ,an error occurs as
configure: error: Package requirements (pygobject-3.0 >= 2.90.1) were not met:
No package 'pygobject-3.0' found
So I go back and try to install pygobject and found:
configure: error: Package requirements (glib-2.0 >= 2.24.0
gobject-introspection-1.0 >= 1.29.0
) were not met:
No package 'gobject-introspection-1.0' found
Excuse me ???
Is that the same thing we all have to suffer during install pyatspi???
What should I do to jump out from this nightmare?
Thanks for any help !
pyatspi is a part of GNOME. What you got involved into by building pyatspi from source was leading you into building a significant part of GNOME from source. No easy task at all.
Your best bet is to find AT SPI package for your distribution. You did not specify what linux distribution do you have. But for most common distributions such packages exist.
First make sure you have got python-gobject installed
For rpm-based distributions
rpm -q python-gobject
For dpkg-based:
dpkg -s python-gobject
Install it if necessary.
Next install a package containing pyatspi for your distribution.
For instance for OpenSUSE you need to install python-atspi
zypper in python-atspi
For Ubuntu and derivatives it is python-pyatspi:
apt-get install python-pyatspi
For RedHat, Fedora and derivatives it is at-spi-python
yum install at-spi-python
Having got that you should be able to type
python -c "import gi,pyatspi"

Python ImportError: No module named serial

I have installed Python 2.7.5 on Ubuntu 12.4 on a DELL LATITUDE E4300 64 bit and ran:
sudo pip install pyserial
nevertheless when running:
sudo python main.py
I receive the following error message:
Traceback (most recent call last):
File "main.py", line 4, in <module>
from mySerial import *
File "/home/oscar/ath10k/tools/sanity_test/src/mySerial.py", line 6, in <module>
import serial
ImportError: No module named serial
I looked on other posts but none of them helped me to solve this problem. I don't know what else to do I also ran:
sudo -H pip install pyserial
and
sudo pip install pyserial --upgrade
Any help will be greatly appreciated.
Kind regards.
Oscar.
On my ubuntu 14.4 with python 2.7 as default, I installed pyserial for python3 (which my IDE is using actually) with the help of following command:
sudo apt-get install python3-serial
Your script name is exactly like module name, change mySerial.py to something else.
I solved this by installing pyserial from source code instead than doing it with pip.
I do not know why it works this way and when using pip it prints error messages.

Unable to install matplotlib (virtualenv)

This is my first question so apologies about format etc.
I'm trying to do the python exercise on http://newcoder.io/dataviz/part-0/ and I'm attempting to install the pre-requisites for working within a virtualenv.
At the stage
(DataVizProj)$ pip install numpy
(DataVizProj)$ pip install matplotlib
It seems to install fine. However on testing matplotlib within python itself (running a python terminal and then trying "import matplotlib") I am getting the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named matplotlib
I have also tried sudo apt-get build-dep matplotlib but every time I am getting the above error. I have googled to no avail - can anybody assist?
P.s. I am using Ubuntu

Categories

Resources