Archive
Posts Tagged ‘manjaro’
“import tkinter” fails
April 27, 2016
Leave a comment
Problem
Under Manjaro I wanted to use the turtle module but I got this error:
File "square.py", line 1, in <module>
import turtle
File "/usr/lib/python2.7/lib-tk/turtle.py", line 107, in <module>
import Tkinter as TK
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
Solution
sudo pacman -S tk
Ubuntu 14.04
I had the same problem under Ubuntu when I tried to use matplotlib on a remote server.
sudo apt install python3-tk
Anaconda: problem with the readline module under Manjaro
October 5, 2015
Leave a comment
Problem
I tried the Anaconda Python distribution under Manjaro, but there was a problem with the “readline” module:
>>> import readline Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: libncursesw.so.5: cannot open shared object file: No such file or directory
Solution
As root:
# cd /usr/lib # ln -s libncursesw.so libncursesw.so.5
It may be an ugly hack, but it solved the issue for me.
creating a Python 3 virt. env. on Ubuntu
May 17, 2015
Leave a comment
Problem
Python 3 on Ubuntu is sometimes a total mess. I wanted to create a Python 3 virt. env., but I got this error:
$ virtualenv -p python3 venv
Running virtualenv with interpreter /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 8, in
import base64
File "/usr/lib/python3.4/base64.py", line 9, in
import re
File "/usr/lib/python3.4/re.py", line 324, in
import copyreg
File "/usr/local/lib/python2.7/dist-packages/copyreg.py", line 3, in
from copy_reg import *
ImportError: No module named 'copy_reg'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 53, in apport_excepthook
if not enabled():
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 24, in enabled
import re
File "/usr/lib/python3.4/re.py", line 324, in
import copyreg
File "/usr/local/lib/python2.7/dist-packages/copyreg.py", line 3, in
from copy_reg import *
ImportError: No module named 'copy_reg'
Original exception was:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 8, in
import base64
File "/usr/lib/python3.4/base64.py", line 9, in
import re
File "/usr/lib/python3.4/re.py", line 324, in
import copyreg
File "/usr/local/lib/python2.7/dist-packages/copyreg.py", line 3, in
from copy_reg import *
ImportError: No module named 'copy_reg'
Awesome! :(
Solution
I found a working solution here. The following command let me create a Python 3 virt. env.:
python3 -c 'import sys; del sys.argv[0]; s = sys.argv[0]; exec(open(s).read(), {"__file__": s, "__name__": "__main__"})' `which virtualenv` -p python3 venv
Life on Arch / Manjaro is easier. There Python 3 has been the default for years.
Categories: python
arch, manjaro, python3, ubuntu, virtualenv, workaround
