Reputation: 1
I have to connect pulser TEKTRONIX AFG3252 via USB to a computer operated within internal highly controlled network. Unfortunately the generator does not support virtual serial port communication. Thus, I have to use pyvisa, but due to network restrictions I cannot use PIP to install it. Sysadmin told me that I have to download it by myself from the official repository and compile it by myself. I was adviced by sysadmin to follow this manual:
https://docs.python.org/3.8/distutils/builtdist.html
And I stuck.
Newest version of pyvisa does not support other ways to install it than via PIP (checked with their support). Thus I have downloaded legacy version from commit:
https://github.com/pyvisa/pyvisa/tree/d1604e70b9483853df751162eb93518deee075f2
To simplify further actions I decided to try solutions first on my personal computer running Ubuntu 22.04 (to avoid many complications including authentication of the access to remote computer every few hours and waisting time for waiting until somebody let me in). I have removed pyvisa via PIP from my ubuntu. Then downloaded ZIP file from the above commit and then:
sudo python3 setup.py bdist
output:
/usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_scm_version'
warnings.warn(msg)
running bdist
running bdist_dumb
running build
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
installing to build/bdist.linux-x86_64/dumb
running install
running install_egg_info
running egg_info
writing UNKNOWN.egg-info/PKG-INFO
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
writing top-level names to UNKNOWN.egg-info/top_level.txt
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README'
no previously-included directories found matching 'docs/build'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*__pycache__*' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
adding license file 'LICENSE'
adding license file 'AUTHORS'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
Copying UNKNOWN.egg-info to build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/dist-packages/UNKNOWN-0.0.0.egg-info
running install_scripts
Creating tar archive
removing 'build/bdist.linux-x86_64/dumb' (and everything under it)
Then I have entered build/bdist.linux-x86_64/rpm/SOURCES/
extracted tar.gz archive and entered directory UNKNOWN-0.0.0
Inside the directory I have called the command:
sudo python3 setup.py install
output:
/usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_scm_version'
warnings.warn(msg)
running install
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running bdist_egg
running egg_info
creating UNKNOWN.egg-info
writing UNKNOWN.egg-info/PKG-INFO
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
writing top-level names to UNKNOWN.egg-info/top_level.txt
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README'
no previously-included directories found matching 'docs/build'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*__pycache__*' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
adding license file 'LICENSE'
adding license file 'AUTHORS'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to install
creating build
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/UNKNOWN-0.0.0-py3.10.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing UNKNOWN-0.0.0-py3.10.egg
Copying UNKNOWN-0.0.0-py3.10.egg to /usr/local/lib/python3.10/dist-packages
Adding UNKNOWN 0.0.0 to easy-install.pth file
Installed /usr/local/lib/python3.10/dist-packages/UNKNOWN-0.0.0-py3.10.egg
Processing dependencies for UNKNOWN==0.0.0
Finished processing dependencies for UNKNOWN==0.0.0
I have to use sudo as I am accessing USB. I hope on the server running on ALMA9 i could work it around somehow. Also compilation requires sudo privileges on my local computer (hope this won't be a problem on ALMA9, as I have no root privileges there).
For a test of pyvisa I'm running simple python script:
import pyvisa as visa
print("Pyvisa test")
pyvisa_version = visa.__version__
print("PyVisa version: " + pyvisa_version)
And output:
Pyvisa test
Traceback (most recent call last):
File "/home/bartek/Job/ZDC/pulser_afg3252/pyvisa_test.py", line 14, in <module>
pyvisa_version = visa.__version__
AttributeError: module 'pyvisa' has no attribute '__version__'
So seems like there is no library installed.
I also tried:
sudo python3 setup.py bdist_rpm
sudo python3 setup.py bdist_wheel
Same result.
I am not very experienced with python and I never tried to compile any library by myself.
Upvotes: 0
Views: 83