Greeting, well today I perform the upgrade form Mint 19.3 Cinnamon to Mint 20. I got some warning about ppa’s and continued. The upgrade seem to take a long time, something like 20-30 minutes, but otherwise seem to gone OK. I now wish I had done a clean install. (I still might do that.)
Anyway, my problem is when I issue this command at the terminal ‘sudo pip3 install py_sg ’ I get a whole page of an error message.
Using cached py_sg-0.11.tar.gz (2.8 kB)
Building wheels for collected packages: py-sg
Building wheel for py-sg (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv = '”’"’/tmp/pip-install-eomws4lc/py-sg/setup.py’"’"’; file=’"’"’/tmp/pip-install-eomws4lc/py-sg/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d /tmp/pip-wheel-uu8_35ri
Complete output (12 lines):
building ‘py_sg’ extension
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c py_sg.c -o build/temp.linux-x86_64-3.8/py_sg.o
py_sg.c:12:10: fatal error: Python.h: No such file or directory
12 | #include <Python.h>
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
ERROR: Failed building wheel for py-sg"
I looked and don’t have any PPA’s listed anymore. So maybe that’s the problem?
The terminal command before this was (and it looked to run correctly)
“sudo apt-get install python3-pip”
… and the the last few lines of the output was
Setting up python3-setuptools (45.2.0-1) …
Setting up python3-wheel (0.34.2-1) …
Setting up python-pip-whl (20.0.2-5ubuntu1) …
Setting up python3-pip (20.0.2-5ubuntu1) …
Processing triggers for man-db (2.9.1-1) …
which got me further thru my procedure. Can you tell me what lead you to this answer -or- would it just go over my head at this time?
sudo pip3 install py_sg now gave me (the last 3 lines)
“Successfully built py-sg
Installing collected packages: py-sg
Successfully installed py-sg-0.11”
And the first part of wdpassport-utils.py is;
from hashlib import sha256
from random import randint
except ImportError, e:
print “You need to install the “py_sg” module.”
Which means I got an error on the “import py_sg” ----->so I changed py_sg to py_sg.so and now I get;
sudo ~/wdpassport-utils.py.2 -u
Traceback (most recent call last):
File “/home/easyt50/wdpassport-utils.py.2”, line 11, in
ModuleNotFoundError: No module named ‘pyudev’
py.2 first few lines looked a bit different;
from hashlib import sha256
from random import randint
regarding just that last section, the instructions want you to use a program git to clone all of the information in that repository. i have only used it successfully twice myself so would suggest waiting to see if someone else can help you work through the errors you posted above.
it may help to post a link to the directions you are following. this sounds like you are rebuilding that program that gives you access to encrypted (or password-protected?) external drives. being able to see the whole process instead of just the errors might point things in the right direction.
Well @01101111, on the road to Linux I had 3 major problems to solve to have a successful system that most users do not have to deal with.
1 - Lenove laptop with a touch screen cause jumping cursor.
2 - Truecrypt to install (I did find Veracrypt as a replacement)
3 - (This problem) Western Digital encrypted disks.
For each Distro I install or test I need to solve all 3 on this PC or items 2 & 3 on other PC. So I documented the procedure that worked on Linux Mint 18.3 Cinnamon. Oh and by the way, it was the support / help of you, @Akito, @abhishek and @ElectricDandySlider that help me get these problems resolved.
Listed below is the proc that worked on Linux 18.3. I use it as a guide. This proc worked**
Thanks again for your help @Akito. I swear, I just don’t understand why Python3 worked one time and now Python2 works this time.
It almost seems like Linux Mint 19 upgraded to Python 3 and now Linux Mint 20 is back on Python2.
i realize you have a method that works and i’m not trying to add more steps to anything, but i just ran through an install and thought i could answer this question. if you want to stick with what you have and ignore the rest, i would completely understand
it looks like you are using a mixture of the old and new directions since a few things have changed other than using python3. the new directions from the project’s github:
You’ll need the Python 3 development headers to install this tool. On Ubuntu run:
in addition to the python3 packages, the first install group adds git which is used to install the packages in the second and third steps.
the github page also explains:
crypto-universe converted this project and the underlying SCSI interface library py_sg to Python 3.
i believe that’s probably how you came by the crypto-universe link you shared above. the third step installs that new python3 py_sg package instead of the one that gets used if you run sudo pip3 install py_sg.
I’m not a bit surprise. I’m not afraid of terminal commands (I know how to restore), but most of the commands I type in are on good faith. I really don’t understand an awful lot of them.
Feel free to update my proc and even add comment. I would be glad to to use it and hopefully learn from it. I been playing around with MX19 and if I fully test it out I will need to add support for WD external disks.
in all honesty, timeshift helped me come to a similar place of less worry or anxiety about running commands i am unfamiliar with. i do tend to check out the man page before i run something new to try and make sure i am not getting in over my head.
so they should work just fine for ubuntu 20 or anything based on it like mint 20 with whichever de you choose.
the first step is like the one you used before (sudo apt-get install python-pip python-dev lsscsi), but adds the installation of python3 itself and updates the other two packages to the python3 version. git is added to help with the next two steps. on ubuntu-based distros (more about mx19 later) this step also takes care of the second one you were using before (sudo apt install python-setuptools python-wheel). those packages (updated to python3 versions) were installed along with the three listed.
the third step uses the same process as the second to replace the third step you had before (sudo pip install py_sg) to install the final piece of the program and i believe the --user option means you don’t have to add /home/easyt50/ or ~/ when you run the program. i simply ran sudo wdpassport-utils.py and it worked.
part of the reason i made that previous post was because you had mentioned distro hopping and mx19. i was curious to see if an install was different on something debian-based so i tried it on an mx19.2 vm. it turned out that the second of these new three steps failed because python3-setuptools python3-wheel were not automatically installed with the first step. once i installed them, everything went just as easily as it had with mint 20 xfce.
so for mx 19.2 (and probably other debian-based distros, but no promises ) the process was these four steps: