"import _struct" error - python

I receive the following error when installing python 2.7.9 from these instructions:
Traceback (most recent call last):
File "/usr/lib/python2.7/compileall.py", line 16, in <module>
import struct
File "/usr/lib/python2.7/struct.py", line 1, in <module>
from _struct import *
ImportError: No module named _struct
make: *** [libinstall] Error 1
How do I make this error go away?

Related

ImportError: No module named torch in python

I am trying to run my python file. I am running this command:
python3 run.py --input_folder test_images/old_w_scratch --output_folder output --GPU 0 --with_scratch
But I get this error:
Running Stage 1: Overall restoration
Traceback (most recent call last):
File "detection.py", line 12, in <module>
import torch
ImportError: No module named torch
Traceback (most recent call last):
File "test.py", line 6, in <module>
from torch.autograd import Variable
ImportError: No module named torch.autograd
Traceback (most recent call last):
when i install torch, it installs properly. But then when i run this, it doesn't work. Any chances someone could help me with it?

pyproj.database and pyproj.aoi import failed

I have installed the pyproj.2.6.1 version, and I am using the python3.8.8; I can't correctly import the module query_utm_crs_info from pyproj package.
Here below the code :
from pyproj import Proj, Transformer, CRS
from pyproj.database import query_utm_crs_info
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyproj.database'
Similar problem with AreaOfInterest
from pyproj.aoi import AreaOfInterest
and I received this message
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyproj.aoi'
However, if I change it in to
from pyproj.transformer import AreaOfInterest
Any suggestions ?
https://pyproj4.github.io/pyproj/stable/api/database.html#pyproj.database.query_crs_info
query_crs_info was added in pyproj 3.

Unable to import pcl in conda

I have installed python-pcl| using pip. When I try to import pcl in my conda environment I am getting the following
ERROR
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/is/sg2/ghegde/install/conda/envs/deepl/lib/python3.6/site-packages/pcl/__init__.py", line 2, in <module>
from ._pcl import *
ImportError: /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.8: undefined symbol: _ZN3pcl9PCDWriter10writeASCIIERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_14PCLPointCloud2ERKN5Eigen6MatrixIfLi4ELi1ELi0ELi4ELi1EEERKNSC_10QuaternionIfLi0EEEi

test_ssl.py and test_urllib2.py tests are failing in python2.7

test_ssl.py
root#yasir:/home/yasir/PYTHON/python2.7-2.7.6/Lib/test# python python test_ssl.py
Traceback (most recent call last):
File "test_ssl.py", line 7, in <module>
from test.script_helper import assert_python_ok
ImportError: No module named script_helper
test_urllib2.py
root#yasir:/home/yasir/PYTHON/python2.7-2.7.6/Lib/test# python test_urllib2.py
Traceback (most recent call last):
File "test_urllib2.py", line 3, in <module>
from test import test_urllib
ImportError: cannot import name test_urllib
I'm not able to understand which module is missing so facing this error
tests failed due to missing python module libpython2.7-testsuite

No module named pycurl on mac terminal

When I start .py file I got this error? Why?
Traceback (most recent call last):
File "/Users/omercancelikler/webstagram.py", line 3, in <module>
import pycurl
ImportError: No module named pycurl

Categories

Resources