Open Kurtvanpelt opened 1 week ago
Hi!
It seems that you're having issues installing packages from the requirements.txt file due to Python version compatibility.
Could you please share the following:
!python --version
With this information, I can assist you better😊.
Hi,
I have used method 1, so by creating a environment in anaconda and then opening this in Juptitar Lab to do run this code.
For the second thing see the attachements
Hi,
Since we have tested the requirements.txt
on the Python versions specified in the instructions, the issue might be specific to your setup.
Let's try a few things:
Create a new environment with Python 3.11.10: Please try creating a new environment in Anaconda following the instructions in 5.A. Setting up with Anaconda
.
Update Anaconda and Try Again: If the problem persists, update Anaconda itself, and then try creating the environment again with Python 3.11:
conda
and Anaconda:
conda update conda
conda update anaconda
Gabriel
I have the exact same problem, and i have changed my workspace to 3.11.10, but i cannot seem to update jupyter to use that same version. Any particular steps that have to be followed?
I changed worspace, downloaded the files again, closed jupyter and my browser. In my terminal it gives the right version, but when getting the version in jupyter it just does not update.
Can you try installing biogeme using these command in cells:
First cell:
!python --version
Check the version is 3.11.x
Second cell:
!python -m pip install biogeme
Let me know if using this was the package is installed
Okay so I maybe was not clear but I will show you what is wrong. My workspace is set to 3.11.10 as you can see by the print sys comment, but for some reason jupyter still uses 3.12. as its python version
When running the instal for biogeme it goes a long way but still gives errors. Same for the installment of all stuff in the text file.
using the update conda line does not work in jupyter
Thank you for the clarification @SilvesterdenBoer. I think now I understood the issue. If I am not wrong is in the other way around:
print(sys.version)
shows you the Python version used when you execute cells. So, in your case the cells are executed by 3.11
!python --version
calls python from your terminal/cmd at computer level. In your case this is 3.12
When you do "pip install" in your terminal (Are you using macOS btw?), installs the packages in 3.12. It installs with errors, buton 3.12. So, when you run a cell, it runs from 3.11 which doesn't have biogeme.
I suggest to stuck to 3.11 as it is more stable. The good thing is you have already configured 3.11 in Jupyter.
Now you have to be able to install the packages on 3.11 as well (not in 3.12 as your default is):
We have to locate your python3.11 for forcing the terminal with pip to install the dependencies on 3.11.
Did you create a virtual environment or a conda environment? The easiest way is to activate that environment, and then do pip install biogeme
If not, I strongly suggest to create a new environment, activate it and then install with pip.
Then, lunch Jupyter from conda using the specified env.
Another way is to identify the path where the python 3.11 is located. You can run:
print(sys.path)
This should see different paths. Usually anaconda install stuffs in /opt/anaconda3/lib/python3.11. Once identified, you can run this line for installing biogeme in 3.11
/opt/anaconda3/lib/python3.11 -m pip install biogeme
make sure you check your own path.
I hope it helps! Francisco
Got it! Thanks Francisco!
Thank you Gabriel for you explanation. When I create I new environment I still have the same issues. You said that I then must update my anaconda in anaconda prompt. What is the anaconda prompt exactly? I am trying this on MacOS.
Hi @Kurtvanpelt,
To update Anaconda on your Mac, please follow these steps in Terminal:
Run the following commands:
conda update conda
conda update anaconda
After updating, please try creating the environment again with Python 3.11.10. Then, launch JupyterLab directly from this environment, open the notebook, and run !python --version
in the first cell of the lab file.
If everything works, run the cell to install the requirements: !pip install ../../requirements.txt
Let me know if this resolves the issue.
I solved it in the end by changing doing the following:
To edit the requirements.txt file to use a compatible version of torch, follow these steps:
Open requirements.txt: Locate and open the requirements.txt file in a text editor.
Find the Line with torch==2.3.1: Look for the line that specifies torch==2.3.1.
Edit the Version: Change torch==2.3.1 to torch==2.2.2, which is compatible with Python 3.11.10:
Thank you @jvanhoeve this actually works, so now I can run the notebook.
Hi @jvanhoeve
What type of machine do you have, windows, Mac intel, or Mac silicon? Did you use anaconda to install the requirements?
Hi,
I have an Macbook Pro with an intel chip. And used anaconda to install all the requirements
Kind regards,
Joppe van Hoeve
From: Gabriel Nova @.> Date: Monday, 18 November 2024 at 08:47 To: SEN1221TUD/Q2_2024 @.> Cc: jvanhoeve @.>, Mention @.> Subject: Re: [SEN1221TUD/Q2_2024] Can't import Biogeme (Issue #2)
Hi @jvanhoevehttps://github.com/jvanhoeve
What type of machine do you have, windows, Mac intel, or Mac silicon? Did you use anaconda to install the requirements?
— Reply to this email directly, view it on GitHubhttps://github.com/SEN1221TUD/Q2_2024/issues/2#issuecomment-2482179608, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BM62NY54AUJGDLJ5FJIFG2T2BGLQHAVCNFSM6AAAAABRUST6GWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBSGE3TSNRQHA. You are receiving this because you were mentioned.Message ID: @.***>
I tried to import biogeme , but I got the error:no module called biogeme. I think something went wrong with the installation of the requirement text (see error). I don't understand what the issue is here. I think I have installed the newest juptiper lab, but I am not sure where I can find that. Can you help me solving this issue