kthpanor / vlxman

8 stars 3 forks source link

Installation with Google Colab #4

Open yychuang opened 9 months ago

yychuang commented 9 months ago

Hi I am thinking about teaching computational chemistry course with veloxchem package. However, I seem to have trouble trying to install with Google Colab. I wonder if there is any suggestion to do this? Thanks

kthpanor commented 9 months ago

Hi John,

There can e.g. be an issue using Colab caused by mismatch in the Python version (e.g. 3.9 from Google Colab and 3.10 from latest miniconda).

Here's the link to a notebook addressing this issue:

https://colab.research.google.com/drive/1kWhtTeCaCnTMjWeiU6TWTAoSfEuLPxLN?usp=sharing

There are a list of things that are important here:

That said, after having used VeloxChem for teaching at various levels (master and PhD) during the past couple of years, I would recommend that you let students install VeloxChem on their personal computers (laptops) and run the exercises in local Jupyter notebooks. I have not really experienced any severe installation issues and the experience for the student is much better I’d say.

See

https://kthpanor.github.io/echem/docs/install.html

Best wishes, Patrick.

On 29 Sep 2023, at 05:03, john chuang @.***> wrote:

Hi I am thinking about teaching computational chemistry course with veloxchem package. However, I seem to have trouble trying to install with Google Colab. I wonder if there is any suggestion to do this? Thanks — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Patrick Norman e-mail: @.*** Division of Theoretical Chemistry and Biology phone : +46 8 790 96 31 KTH Royal Institute of Technology mobile: +46 73 765 2253 SE-100 44 Stockholm, Sweden Homepage: https://www.kth.se/tcb

yychuang commented 9 months ago

Hello

Thank you for your help. I followed up the python notebook till instllation of veloxchem. I can run the 'vlx' as seperated program (in /usr/local/bin/vlx) but when I tryied to 'import veloxchem as vlx', the following error message appears


ModuleNotFoundError Traceback (most recent call last)

in () ----> 1 import veloxchem as vlx /usr/local/lib/python3.9/site-packages/veloxchem/__init__.py in 25 26 # C++ classes ---> 27 from .veloxchemlib import AtomBasis 28 from .veloxchemlib import BasisFunction 29 from .veloxchemlib import OverlapIntegralsDriver ModuleNotFoundError: No module named 'veloxchem.veloxchemlib' --------------------------------------------------------------------------- NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt. To view examples of installing some common dependencies, click the "Open Examples" button below. --------------------------------------------------------------------------- ---- when I tried to run the /usr/local/lib/python3.9/site-packages/veloxchem/__init__.py script it gave the following error ------- Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/veloxchem/__init__.py", line 27, in from .veloxchemlib import AtomBasis ImportError: attempted relative import with no known parent package ------- sorry for bothering you, but I guess it might be almost there, but I don't know where to look for. Thank you for your advice to have students install veloxchem on their laptops, I will give it a try, but I have a feeling that most of my students cannot do it. thank you John -----Original message----- From:Patrick ***@***.***> ***@***.***> Cc:john ***@***.***>***@***.***> Date: Fri, 29 Sep 2023 13:32:07 Subject: Re: [kthpanor/vlxman] Installation with Google Colab (Issue #4) Hi John, There can e.g. be an issue using Colab caused by mismatch in the Python version (e.g. 3.9 from Google Colab and 3.10 from latest miniconda). Here's the link to a notebook addressing this issue: https://colab.research.google.com/drive/1kWhtTeCaCnTMjWeiU6TWTAoSfEuLPxLN?usp=sharing There are a list of things that are important here: - Check that the default python on Google Colab is under /usr/local - Check that the version of the default python is 3.9 - Set PYTHONPATH to empty - Install miniconda with python 3.9 under /usr/local - Append /usr/local/lib/python3.9/site-packages to sys.path That said, after having used VeloxChem for teaching at various levels (master and PhD) during the past couple of years, I would recommend that you let students install VeloxChem on their personal computers (laptops) and run the exercises in local Jupyter notebooks. I have not really experienced any severe installation issues and the experience for the student is much better I’d say. See https://kthpanor.github.io/echem/docs/install.html Best wishes, Patrick. > On 29 Sep 2023, at 05:03, john chuang ***@***.***> wrote: > > > Hi > I am thinking about teaching computational chemistry course with veloxchem package. However, I seem to have trouble trying to install with Google Colab. I wonder if there is any suggestion to do this? Thanks > — > Reply to this email directly, view it on GitHub, or unsubscribe. > You are receiving this because you are subscribed to this thread.Message ID: ***@***.***> -- --------------------------------------------------------------------------- Patrick Norman e-mail: ***@***.*** Division of Theoretical Chemistry and Biology phone : +46 8 790 96 31 KTH Royal Institute of Technology mobile: +46 73 765 2253 SE-100 44 Stockholm, Sweden Homepage: https://www.kth.se/tcb --------------------------------------------------------------------------- — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***>
kthpanor commented 9 months ago

Thank you for your advice to have students install veloxchem on their laptops, I will give it a try, but I have a feeling that most of my students cannot do it.

I think you will be surprised how smooth it can turn out in the end. Personally I made sure to try it out on a Mac and a Windows laptop before the course started so that I had a personal experience on both operating systems. Then I really didn’t meet any issues.

Just make sure to follow the instructions and use miniconda. Remove packages from the YML file that you do not intend to use to speed up the installation process. On Windows, use the Anaconda Powershell terminal. That should do it.

Good luck!

Best, Patrick.

--

Patrick Norman e-mail: @.*** Division of Theoretical Chemistry and Biology phone : +46 8 790 96 31 KTH Royal Institute of Technology mobile: +46 73 765 2253 SE-100 44 Stockholm, Sweden Homepage: https://www.kth.se/tcb

On 29 Sep 2023, at 11:24, john chuang @.***> wrote:

Hello

Thank you for your help. I followed up the python notebook till instllation of veloxchem. I can run the 'vlx' as seperated program (in /usr/local/bin/vlx) but when I tryied to 'import veloxchem as vlx', the following error message appears



ModuleNotFoundError Traceback (most recent call last)

in () ----> 1 import veloxchem as vlx /usr/local/lib/python3.9/site-packages/veloxchem/__init__.py in 25 26 # C++ classes ---> 27 from .veloxchemlib import AtomBasis 28 from .veloxchemlib import BasisFunction 29 from .veloxchemlib import OverlapIntegralsDriver ModuleNotFoundError: No module named 'veloxchem.veloxchemlib' --------------------------------------------------------------------------- NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt. To view examples of installing some common dependencies, click the "Open Examples" button below. --------------------------------------------------------------------------- ---- when I tried to run the /usr/local/lib/python3.9/site-packages/veloxchem/__init__.py script it gave the following error ------- Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/veloxchem/__init__.py", line 27, in from .veloxchemlib import AtomBasis ImportError: attempted relative import with no known parent package ------- sorry for bothering you, but I guess it might be almost there, but I don't know where to look for. Thank you for your advice to have students install veloxchem on their laptops, I will give it a try, but I have a feeling that most of my students cannot do it. thank you John -----Original message----- From:Patrick ***@***.***> ***@***.***> Cc:john ***@***.***>***@***.***> Date: Fri, 29 Sep 2023 13:32:07 Subject: Re: [kthpanor/vlxman] Installation with Google Colab (Issue #4) Hi John, There can e.g. be an issue using Colab caused by mismatch in the Python version (e.g. 3.9 from Google Colab and 3.10 from latest miniconda). Here's the link to a notebook addressing this issue: https://colab.research.google.com/drive/1kWhtTeCaCnTMjWeiU6TWTAoSfEuLPxLN?usp=sharing There are a list of things that are important here: - Check that the default python on Google Colab is under /usr/local - Check that the version of the default python is 3.9 - Set PYTHONPATH to empty - Install miniconda with python 3.9 under /usr/local - Append /usr/local/lib/python3.9/site-packages to sys.path That said, after having used VeloxChem for teaching at various levels (master and PhD) during the past couple of years, I would recommend that you let students install VeloxChem on their personal computers (laptops) and run the exercises in local Jupyter notebooks. I have not really experienced any severe installation issues and the experience for the student is much better I’d say. See https://kthpanor.github.io/echem/docs/install.html Best wishes, Patrick. > On 29 Sep 2023, at 05:03, john chuang ***@***.***> wrote: > > > Hi > I am thinking about teaching computational chemistry course with veloxchem package. However, I seem to have trouble trying to install with Google Colab. I wonder if there is any suggestion to do this? Thanks > — > Reply to this email directly, view it on GitHub, or unsubscribe. > You are receiving this because you are subscribed to this thread.Message ID: ***@***.***> -- --------------------------------------------------------------------------- Patrick Norman e-mail: ***@***.*** Division of Theoretical Chemistry and Biology phone : +46 8 790 96 31 KTH Royal Institute of Technology mobile: +46 73 765 2253 SE-100 44 Stockholm, Sweden Homepage: https://www.kth.se/tcb --------------------------------------------------------------------------- — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: ***@***.***>