Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running from conda env python exe #11

Open
nahhhhhhhhhhhhhhhhhhhhh opened this issue Feb 14, 2023 · 0 comments
Open

Error when running from conda env python exe #11

nahhhhhhhhhhhhhhhhhhhhh opened this issue Feb 14, 2023 · 0 comments

Comments

@nahhhhhhhhhhhhhhhhhhhhh

Hi,

I have anaconda installed and set up an environment with openbabel. It runs great when running from anaconda however i need to run through other software where i have to set the python interpreter "C:\ProgramData\Anaconda3\envs\python3-10-9\python.exe" and that's where the problems begin. How do i get it to open the environment as a conda environment or what do i have to set in my script to get it to work?

I need it for Spotfire data functions

from the python exe

Python 3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from openbabel import pybel
>>> print(pybel.readstring("smi", "CN2C(=O)N(C)C(=O)C1=C2N=CN1C").write("can"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\python3-10-9\lib\openbabel\pybel.py", line 200, in readstring
    raise ValueError("%s is not a recognised Open Babel format" % format)
ValueError: smi is not a recognised Open Babel format

How do i start python like this? keeping in mind i have to be able to set the path like this "C:\ProgramData\Anaconda3\envs\python3-10-9\python.exe"
what does anaconda run when we click "Run with Python"?

C:\Users\Administrator>conda.bat activate "C:\ProgramData\Anaconda3\envs\python3-10-9"

C:\Users\Administrator>set OLD_BABEL_DATADIR=C:\ProgramData\Anaconda3\envs\python3-10-9\share\openbabel

C:\Users\Administrator>set BABEL_DATADIR=C:\ProgramData\Anaconda3\envs\python3-10-9\share\openbabel
Python 3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from openbabel import pybel
>>> print(pybel.readstring("smi", "CN2C(=O)N(C)C(=O)C1=C2N=CN1C").write("can"))
Cn1cnc2c1c(=O)n(C)c(=O)n2C

>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant