PyKCS11 installation - python

I want to install and use PyKCS11 to my mac (via terminal). I want to use python3 for the whole process. I downloaded it from here: https://bitbucket.org/PyKCS11/pykcs11.
I have python3 installed at /usr/local/lib. I downloaded the folder, ran make build, and everything was ok. When i run make install i get the following:
python3 setup.py install --prefix=/usr/local --root=/
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing /usr/local/lib/python3.4/site-packages/PyKCS11-1.3.2-py3.4.egg-info
Writing /usr/local/lib/python3.4/site-packages/PyKCS11-1.3.2-py3.4.egg-info
(*Removing... is from the previous time i executed the command)
After that, i open python3 and execute import PyKCS11
and i get the following error:
>>> import PyKCS11
Traceback (most recent call last):
File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_LowLevel', [dirname(__file__)])
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_LowLevel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/__init__.py", line 20, in <module>
import PyKCS11.LowLevel
File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 28, in <module>
_LowLevel = swig_import_helper()
File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 20, in swig_import_helper
import _LowLevel
ImportError: No module named '_LowLevel'
Could it be a problem that python3 cannot use swig?
Python2 is installed at a different location (/usr/lib/python2.7)
I used Homebrew to install python.
Any ideas appreciated.
Thanks in advance!

you need to come out from PyKCS11 directory and for more info check the below link
https://github.com/LudovicRousseau/PyKCS11/issues/70

Related

Module not found error when importing umfpack MacOS Monterey M1 chip

I installed umfpack using pip install scikit-umfpack and tried importing the umfpack module
from scikits import umfpack
I'm running into the following error:
Traceback (most recent call last):
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/_umfpack.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('__umfpack', [dirname(__file__)])
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '__umfpack'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/__init__.py", line 12, in <module>
from .umfpack import *
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/umfpack.py", line 130, in <module>
from . import _umfpack as _um
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/_umfpack.py", line 28, in <module>
__umfpack = swig_import_helper()
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/_umfpack.py", line 20, in swig_import_helper
import __umfpack
ModuleNotFoundError: No module named '__umfpack'
Christian, it's not easy:
pypi umfpack says: first build a local SuiteSparse UMFPACK
building SuiteSparse libraries requires some knowledge of Makefiles
and on macos otool / install_name_tool
before pip install, you need a suitable ~/.numpy-site.cfg.
Added: the setup.py is old and messy;
I had a simpler one which worked onceaponatime, let me know.
You could also try `conda install scikit-umfpack` instead of `pip`,
BUT mixing different package managers is asking for trouble;
if you do, keep the pip and conda package trees separate.

ModuleNotFoundError: No module named 'nvidia.dali.backend_impl' when running nvidia/deeplearningexamples reponstory

run rn50 scripts in NVIDIA/DeepLearningExamples, as
./rn50_partial.sh
get error like this:
Traceback (most recent call last):
File "/export/nfs/sunxue/DeepLearningExamples/PyTorch/Classification/ConvNets/mnasnet/training/FP32/../../../launch.py", line 7, in <module>
from main import main, add_parser_arguments, available_models
File "/export/nfs/sunxue/DeepLearningExamples/PyTorch/Classification/ConvNets/main.py", line 49, in <module>
from image_classification.dataloaders import *
File "/export/nfs/sunxue/DeepLearningExamples/PyTorch/Classification/ConvNets/image_classification/dataloaders.py", line 79, in <module>
class HybridTrainPipe(Pipeline):
NameError: name 'Pipeline' is not defined
ok, I've solved this, cause NVIDIA does not classify the specific installation, actually, it does not have to install from scratch, if you use pip install, just check which version NVIDIA docker use and download this specific version, pip install, and everything will be ok.

Using Python 3 when Python 2.7 is default, pip install error

I originally had both python 2.7 and python 3 installed with python 2.7 as my default in PATH. I needed to run a script using python 3 but could not set it as my default python in PATH for some reason. After just uninstalling python 2.7 I opened 3 and ran the command python get-pip.py install which gave me this error
C:\Python30>python get-pip.py install
Traceback (most recent call last):
File "c:\users\jacob\appdata\local\temp\tmplqxvtx\pip.zip\pip\compat\__init__.py", line 16, in <module>
ImportError: cannot import name OrderedDict
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "get-pip.py", line 19177, in <module>
main()
File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip
File "c:\users\jacob\appdata\local\temp\tmplqxvtx\pip.zip\pip\__init__.py", line 14, in <module>
File "c:\users\jacob\appdata\local\temp\tmplqxvtx\pip.zip\pip\utils\__init__.py", line 22, in <module>
File "c:\users\jacob\appdata\local\temp\tmplqxvtx\pip.zip\pip\compat\__init__.py", line 18, in <module>
File "c:\users\jacob\appdata\local\temp\tmplqxvtx\pip.zip\pip\compat\ordereddict.py", line 25, in <module>
ImportError: No module named UserDict
I already tried python -m pip install (module name) but it returns No module named pip
I assume you use windows, so here is an answer how to install pip on windows:
how-do-i-install-pip-on-windows
On Linux you could just type:
sudo apt install python-pip

Installing GDAL python binding Linux

I've been trying to install the python GDAL binding from source with ./configure --with-python but when i attemp
from osgeo import gdal
I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "osgeo/__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: libgdal.so.1: cannot open shared object file: No such file or directory
It seems to me to be an error with swig.
If you have GDAL installed and libgdal.so exists, it looks like the python module is just not finding the library. You can try setting the LD_LIBRARY_PATH environment variable to point to the directory containing libgdal.so (e.g. /usr/local/lib). If that works, run ldconfig to update your library settings so you won't have to set LD_LIBRARY_PATH every time (which many consider a bad idea).
You Can try
sudo apt-get install odbcinst1debian2 libgdal1h
and then try importing

Error when building a project

I cloned an organism project from github.
I tried to install it, but there is no one setup.py file and no documentation.
Could you advise me how to correctly build and install it under Ubuntu 12.04?
I tried so far:
sudo python3 organism.setup.py install
which shows error message:
byte-compiling /usr/local/lib/python3.2/site-packages/organism/coreaux/configuration.py to configuration.pyc
File "/usr/local/lib/python3.2/site-packages/organism/coreaux/configuration.py", line 31
_USER_FOLDER_PERMISSIONS = 0750
^
SyntaxError: invalid token
and running it shows this error message:
$ organism
Traceback (most recent call last):
File "/usr/local/bin/organism", line 23, in <module>
organism.main()
File "/usr/local/lib/python3.2/site-packages/organism/__init__.py", line 21, in main
import coreaux
ImportError: No module named coreaux
I'm not sure if I should use all the files organism-development.setup.py, organism-organizer.setup.py, organism.setup.py, organism-tk.setup.py in the build process or the error is elsewhere.

Categories

Resources