module not found error in python while installing tar.gz file - python

I have a virtual env and I am trying to install a private (my company's) package into it. I download the tar.gz file in the project repo and then I do pip install pkg_name --find-links=".". But every time I get this error:
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/49/76fpmgk16_149s5r58lk33040000gq/T/pip-install-7ui62a2g/tmprint_1d674d12ea874b83b3fa7ad42797d36d/setup.py", line 2, in <module>
import distutils.command.bdist_conda
ModuleNotFoundError: No module named 'distutils.command.bdist_conda'
I am using python=3.7.4 on macOs.
Any help is really appreciated.

Related

Mingus/lilypond on python

I can import mingus but sublibraries such as mingus.extra.lilypond give me an error:
import mingus.core.notes
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
import mingus.core.notes
File "C:\Users\PharaohZz\AppData\Local\Programs\Python\Python36\lib\site-packages\mingus\core\notes.py", line 29, in <module>
from mt_exceptions import NoteFormatError, RangeError, FormatError
ModuleNotFoundError: No module named 'mt_exceptions'
or
import mingus.extra.lilypond
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import mingus.extra.lilypond
File "C:\Users\PharaohZz\AppData\Local\Programs\Python\Python36\lib\site-packages\mingus\extra\__init__.py", line 20, in <module>
import lilypond
ModuleNotFoundError: No module named 'lilypond'
You can fix this problem by first uninstalling mingus (pip uninstall mingus).
Then build the library from it's source. To do this:
Download the files from git hub using the command git clone https://github.com/bspaans/python-mingus .
Enter the directory using cd python-mingus.
Finally install it using the command python setup.py install.
This fixed the problem for me.

AttributeError: module 'mxnet' has no attribute 'io'

trying to run this project
and got an error when typing:
python demo.py --gpu 0
on my terminal
the error:
Using mxnet as:
<module 'mxnet' (namespace)>
Warning: using pre-installed version of mxnet may cause unexpected error...
(export MXNET_EXAMPLE_SSD_DISABLE_PRE_INSTALLED=1) to prevent loading pre-installed mxnet.
Traceback (most recent call last):
File "demo.py", line 6, in <module>
from detect.detector import Detector
File "/home/ubuntu-linux/mxnet-ssd/detect/detector.py", line 6, in <module>
from dataset.iterator import DetIter
File "/home/ubuntu-linux/mxnet-ssd/dataset/iterator.py", line 6, in <module>
class DetRecordIter(mx.io.DataIter):
AttributeError: module 'mxnet' has no attribute 'io'
help
after running (git clone --recursive https://github.com/zhreshold/mxnet-ssd.git)
the old error was gone but got this new error:
Traceback (most recent call last):
File "demo.py", line 2, in <module>
import tools.find_mxnet
File "/home/ubuntu-linux/mxnet-ssd/tools/find_mxnet.py", line 15, in <module>
import mxnet as mx
File "/home/ubuntu-linux/mxnet-ssd/tools/../mxnet/python/mxnet/__init__.py", line 7, in <module>
from .base import MXNetError
File "/home/ubuntu-linux/mxnet-ssd/tools/../mxnet/python/mxnet/base.py", line 52, in <module>
_LIB = _load_lib()
File "/home/ubuntu-linux/mxnet-ssd/tools/../mxnet/python/mxnet/base.py", line 43, in _load_lib
lib_path = libinfo.find_lib_path()
File "/home/ubuntu-linux/mxnet-ssd/tools/../mxnet/python/mxnet/libinfo.py", line 42, in find_lib_path
'List of candidates:\n' + str('\n'.join(dll_path)))
RuntimeError: Cannot find the files.
List of candidates:
/home/ubuntu-linux/mxnet-ssd/mxnet/python/mxnet/libmxnet.so
/home/ubuntu-linux/mxnet-ssd/mxnet/python/mxnet/../../lib/libmxnet.so
/home/ubuntu-linux/mxnet-ssd/mxnet/python/mxnet/../../build/Release/libmxnet.so
/usr/local/cuda-8.0/lib64/libmxnet.so
libmxnet.so
../../../libmxnet.so
Looks like the author doesn't want you to use a different version of MXNet than what is included in the project. I see that MXNet is included as a submodule in the project. You should do a recursive clone of the project (git clone --recursive https://github.com/zhreshold/mxnet-ssd.git) and use the version of MXNet that comes with the project.
Remember to export MXNET_EXAMPLE_SSD_DISABLE_PRE_INSTALLED=1 like mentioned in the comments.

Linux undefined symbol _mkdir in the .so file of swmm5 python package

I am new to python and Linux. I installed swmm5 package in Linux by downloading the source SWMM5-5.1.0.102.zip:
python setup.py install
Before typing the previous syntax to install swmm5, I have unquoted #define CLE and deleted #include <direct.h> in the file swmm5.c, otherwise the installation won't succeed.
Then I tried to test the swmm5 package and get the following error:
from swmm5.swmm5tools import SWMM5Simulation
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pyangac/Py_libs/lib64/python/SWMM5-5.1.0.102-py2.7-linux-x86_64.egg/swmm5/swmm5tools.py", line 1, in <module>
from . import swmm5
File "/home/pyangac/Py_libs/lib64/python/SWMM5-5.1.0.102-py2.7-linux-x86_64.egg/swmm5/swmm5.py", line 28, in <module>
_swmm5 = swig_import_helper()
File "/home/pyangac/Py_libs/lib64/python/SWMM5-5.1.0.102-py2.7-linux-x86_64.egg/swmm5/swmm5.py", line 20, in swig_import_helper
import _swmm5
ImportError: /home/pyangac/Py_libs/lib64/python/SWMM5-5.1.0.102-py2.7-linux-x86_64.egg/_swmm5.so: undefined symbol: _mkdir
I have also installed the swmm5 package in Window, and the similar testing process gets no error.
Is there anyone understand what's going on and what should I do to use the swmm5 package in Linux? Thanks.

Python: pip is installed but not working in windows

I have installed python 3.6.0, you don't need to install pip manually if you are using python (>3.3). But When I am trying to access pip (pip --version), it throws me two errors which mainly relate to not finding the module.
Description is given below.
C:\Users\sharma6>pip --version
Traceback (most recent call last):
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 27, in <module>
from . import urllib3
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 7, in <module>
from socket import error as SocketError, timeout as SocketTimeout
File "c:\python360\lib\socket.py", line 49, in <module>
import _socket
zipimport.ZipImportError: can't find module '_socket'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python360\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python360\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\python360\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\python360\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "c:\python360\lib\site-packages\pip\_vendor\requests\__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module>
import urllib3
ModuleNotFoundError: No module named 'urllib3'
Even when I import socket (>>>import socket)in python interpreter , It shows me "Can not found the module" error .
>>> import socket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\python352\lib\socket.py", line 49, in <module>
import _socket
zipimport.ZipImportError: can't find module '_socket
Could someone tell me about the errors and how to resolve them because I need pip to work properly.
Add your all path in your system variable instead of adding in user variable.
It worked for me!!! :)
You should try to write
python -m pip --version
If this gives an error message, install pip by downloading get-pip.py from https://pip.pypa.io/en/stable/installing/ and install with
python get-pip.py
Installing with pip is then done by
python -m pip install [package name]

Having issue with python pip command

I had python pip installed and it was working fine but I did something wrong now it is broken.
Now when I execute pip command to install new packages, I get an error.
like if execute pip list then I get the below error.
root#dragonwarrior-Latitude-3440:~# pip list
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 4, >in <module>
import locale
File "/usr/lib/python2.7/locale.py", line 15, in <module>
import encodings
ImportError: No module named encodings

Categories