Hey there! I’m trying to run riscv-dc using the python generator. For this, one of the requirements are pyvsc , which wouldn’t install using the bundled python 3.11 with fedora 38, so I had to use update-alternatives to install python 3.9(as shown in the image)
The package vsc is clearly present, as demonstrated.
Any help with getting this to work would be much appreciated.
PS - Using a virtual environment is not an option.
You may try to downgrade your python package to the desired releasever. For instance F37 is where Python 3.11 is used so maybe the command would be sudo dnf downgrade python --releasever=37
I tried downgrading to F36, as pyvsc/boolector is only validated till python 3.10. I got the following error:
- Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-36&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]
I tried fixing it by doing what’s mentioned here , but it didn’t work.
Right, sorry about the screenshots. I was having trouble figuring out what parts of the output were relevant.
i) No, it doesn’t work if I use python3.9 instead of python
ii) Could you please elaborate on what this means? I looked up what symlinks are, and I already have the location of both python installs in the path.
The best clue is the error message clearly shows that python3 is the command used, not python.
I suspect that you have not install vsc for the default python3.
Also seems you network is not setup correctly which is why curl failed.
Is this on a company network? Is there firewall blocking your work?
What is the output of
resolvectl
Back to the symlinks. Code often refers to python using python3 not python.
That means that you need to setup python3 to run your preferred version of python.
Having said all that it is often the case that code that works with 3.10 will work with 3.11. I have many versions of python installed on fedora 38 systems.
Then I run the version I need for testing code.
Another thought is that you could use a venv built with your preferred version of python. Then run the tool in from the activated venv.
Yes, this is my first time with a unix system.
Installing vsc for python 3.11 is not possible, as far as I know. Here’s an issue I found which goes into this. boolector is a pre requisite for vsc, and it wouldn;t install with python 3.11, which is why I tried using another version of python, one that had been validated to work with the packages i needed.
Output of resolvectl:
Global
Protocols: LLMNR=resolve -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 2 (wlp1s0)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
Protocols: +DefaultRoute LLMNR=resolve -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 2401:4900:50:9::280
DNS Servers: 125.22.47.125 203.145.160.4 2401:4900:50:9::66 2401:4900:50:9::280
I’ve also tried setting up a virtual environment as detailed here, but didn’t have much luck with that either.
Edit: Running the downgrade command worked fine for --releasever=37 but not for releasever=36
Hello I said F37 has Python 3.11. You should use the docs from Fedora’s site since it is Fedora we are working on here. The downgrade of the package was supposed to f37 Python package. You should have started by removing the Python 3.11 you installed that didn’t help you with your compilation problem, then done a sudo dnf update to make sure your system was sound after removal of the package. Then use the instruction I quoted. You can only downgrade some packages so far.
Okay, so my bad, you want Python 3.9. Please see theses doc’s, they are about doing just what you are asking with Python 3.9 https://developer.fedoraproject.org/tech/languages/python/python-installation.html
Using sudo rm /usr/bin/python3 and sudo ln -s /usr/bin/python3.9 /usr/bin/python3 seems to have done the trick. I realise that this may not be the best way to do this, but I don’t mind it for now, as I’m using fedora only for this one specific task.
The pip packages are called pyvsc and pyboolector.
My understanding is that sudo dnf downgrade python --releasever=37 downgrades only python to that of fedora37’s version.
It worked when I tried it, and for the record, I tried it before I tried --releasever=36.
Thank you and @jakfrost for your help and patience. I’ll mark one of your earlier answers suggesting symlinks as the solution.
I tried to pip install but its trying to use cmake I guess and other build tools that I do not have installed. I’m sure you have solved that part of the problem.
Yes, I’m considering setting up something like conda for this as a permanent fix, but it will have to wait till the weekend. In the mean time, everything’s seemingly normal and run.py works as expected.
I’ll live with the risk in the mean time. Like i said, I only use fedora for this one specific task. Thanks again for your help and suggestions.