Project

General

Profile

Actions

Bug #1076

closed

babeltrace does not add itself to the correct python3 site-packages for certain installations

Added by Daniel U. Thibault over 7 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
11/04/2016
Due date:
% Done:

0%

Estimated time:

Description

Ubuntu 14.04.2 LTS Trusty with a Python3/Anaconda installation (using Anaconda3-4.0.0-Linux-x86_64.sh, python3 and ipython3 from apt), the site-packages used by the PyCharm IDE (PyCharm Community Edition 2016.1.3) is /home/<username>/anaconda3/lib/python3.5/site-packages, while babeltrace installs itself in /usr/local/lib/python3.5/site-packages only. To be able to 'import babeltrace', one must add symbolic links in a subdir of the first path to the second path's files:

# mkdir ~/anaconda3/lib/python3.5/site-packages/babeltrace
# ln -s /usr/local/lib/python3.5/site-packages/babeltrace.py        ~/anaconda3/lib/python3.5/site-packages/babeltrace/babeltrace.py
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.a        ~/anaconda3/lib/python3.5/site-packages/babeltrace/_babeltrace.a
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.la       ~/anaconda3/lib/python3.5/site-packages/babeltrace/_babeltrace.la
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.so.0.0.0 ~/anaconda3/lib/python3.5/site-packages/babeltrace/_babeltrace.so
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.so.0.0.0 ~/anaconda3/lib/python3.5/site-packages/babeltrace/_babeltrace.so.0
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.so.0.0.0 ~/anaconda3/lib/python3.5/site-packages/babeltrace/_babeltrace.so.0.0.0

$ conda --version
conda 4.0.5
$ python --version
Python 3.5.1 :: Anaconda 4.0.0 (64-bit)
$ python3 --version
Python 3.5.1 :: Anaconda 4.0.0 (64-bit)
$ ipython --version
4.1.2
$ ipython3 --version
4.1.2

Mind you, this python setup is pretty messy, so I'm not sure what the portable approach is supposed to be. 'which python3' may be a start...


Files

Actions #1

Updated by Daniel U. Thibault over 7 years ago

Finally got the babeltrace hook-up to work correctly. The links are actually:

# ln -s /usr/local/lib/python3.5/site-packages/babeltrace.py        ~/anaconda3/lib/python3.5/site-packages/babeltrace.py
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.a        ~/anaconda3/lib/python3.5/site-packages/_babeltrace.a
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.la       ~/anaconda3/lib/python3.5/site-packages/_babeltrace.la
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.so.0.0.0 ~/anaconda3/lib/python3.5/site-packages/_babeltrace.so
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.so.0.0.0 ~/anaconda3/lib/python3.5/site-packages/_babeltrace.so.0
# ln -s /usr/local/lib/python3.5/site-packages/_babeltrace.so.0.0.0 ~/anaconda3/lib/python3.5/site-packages/_babeltrace.so.0.0.0

If you create a babeltrace subdir to put the links in, or directly create a link to /usr/local/lib/python3.5/site-packages named ~/anaconda3/lib/python3.5/site-packages/babeltrace, python will think the module is babeltrace.babeltrace and the project will fail.

Actions #2

Updated by Francis Deslauriers over 7 years ago

I encountered this issue as well on Ubuntu 16.04.

The Babeltrace module is installed in the /usr/local/lib/python3/dist-packages/.
In my case, the python3 (3.5.2) interpreter is scanning the following paths only.

/usr/lib/python3/dist-packages
/usr/local/lib/python3.5/dist-packages
/usr/local/lib/python3.5/dist-packages/vlttng-0.6.1-py3.5.egg
/usr/lib/python35.zip
/usr/lib/python3.5
/usr/lib/python3.5/plat-x86_64-linux-gnu
/usr/lib/python3.5/lib-dynload
/home/frdeso/.local/lib/python3.5/site-packages

The entry /usr/local/lib/python3/dist-packages is missing. I think it should be present on all python3.x installation.

This is issue was reported on another project1.

It looks like an upstream issue with the site module that is responsible to generating the sys.path list.

[1][[https://bugs.launchpad.net/ubuntu/+source/python3.5/+bug/1408092?comments=all]]

Actions #3

Updated by Francis Deslauriers over 7 years ago

This issue is related: #1074

Actions #5

Updated by Jonathan Rajotte Julien about 4 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF