ImportError: No module named 'ntpath', when python3 get-pip.py
georgewangchun opened this issue · 5 comments
/usr/bin# python3 --version
Python 3.5.5
I downloaded get-pip.py from https://bootstrap.pypa.io/pip/3.5/
root@2GIG-EDG-77-E4:/usr/bin# python3 --version
Python 3.5.5
root@2GIG-EDG-77-E4:/usr/bin# python3 get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 23974, in
main()
File "get-pip.py", line 199, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
from pip._internal.cli.main import main as pip_entry_point
File "/tmp/tmpndiz5lqo/pip.zip/pip/_internal/cli/main.py", line 10, in
File "/tmp/tmpndiz5lqo/pip.zip/pip/_internal/cli/autocompletion.py", line 9, in
File "/tmp/tmpndiz5lqo/pip.zip/pip/_internal/cli/main_parser.py", line 7, in
File "/tmp/tmpndiz5lqo/pip.zip/pip/_internal/cli/cmdoptions.py", line 25, in
File "/tmp/tmpndiz5lqo/pip.zip/pip/_internal/cli/progress_bars.py", line 12, in
File "/tmp/tmpndiz5lqo/pip.zip/pip/_internal/utils/logging.py", line 18, in
File "/tmp/tmpndiz5lqo/pip.zip/pip/_internal/utils/misc.py", line 21, in
File "/tmp/tmpndiz5lqo/pip.zip/pip/_vendor/pkg_resources/init.py", line 42, in
ImportError: No module named 'ntpath'
/usr/bin# python3 -c "import sys; print('\n'.join(sys.path))"
/usr/lib/python35.zip
/usr/lib/python3.5
/usr/lib/python3.5/plat-linux
/usr/lib/python3.5/lib-dynload
/usr/lib/python3.5/site-packages
/usr/bin# echo $PYTHONPATH
How did you obtain and install Python?
Th python3 is installed from our Yocto project. But it is not convenient for me to change the project configuration now. So I want to manually install pip.
I installed pip in the yocto image. now I got a different error:
/usr/bin# python qr.py
Traceback (most recent call last):
File "qr.py", line 2, in
import pyzbar.pyzbar as pyzbar
File "/usr/lib/python2.7/site-packages/pyzbar/pyzbar.py", line 7, in
from .wrapper import (
File "/usr/lib/python2.7/site-packages/pyzbar/wrapper.py", line 143, in
c_uint_p, # minor
File "/usr/lib/python2.7/site-packages/pyzbar/wrapper.py", line 136, in zbar_function
return prototype((fname, load_libzbar()))
File "/usr/lib/python2.7/site-packages/pyzbar/wrapper.py", line 115, in load_libzbar
libzbar, dependencies = zbar_library.load()
File "/usr/lib/python2.7/site-packages/pyzbar/zbar_library.py", line 66, in load
libzbar = cdll.LoadLibrary(path)
File "/usr/lib/python2.7/ctypes/init.py", line 444, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.7/ctypes/init.py", line 366, in init
self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libzbar.so.0: undefined symbol: dsprintbuf
in zbar\decoder\ean.c
#ifdef DEBUG_EAN
static unsigned char debug_buf[0x18];
static inline const unsigned char *dsprintbuf(ean_decoder_t *ean)
...
But when dsprintbuf() is called it is not wrapped in #ifdef DEBUG_EAN
The issue doesn't seem related toget-pip.py
anymore.