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

bespokefit cannot coexist with pymbar 4 #270

Closed
xiki-tempula opened this issue Jul 6, 2023 · 3 comments
Closed

bespokefit cannot coexist with pymbar 4 #270

xiki-tempula opened this issue Jul 6, 2023 · 3 comments

Comments

@xiki-tempula
Copy link

Description

Another forcebalance dependency issue

Reproduction

mamba create -n bespokefit -c conda-forge -c openeye openff-bespokefit openeye-toolkits xtb-python "libblas=*=*mkl" "pymbar=4"

openff-bespoke executor run --smiles             "CC(=O)NC1=CC=C(C=C1)O"    \
                            --workflow           "default"              \
                            --output             "acetaminophen.json"   \
                            --output-force-field "acetaminophen.offxml" \
                            --n-qc-compute-workers 4                    \
                            --qc-compute-n-cores   1                    \
                            --default-qc-spec xtb gfn2xtb none

Output

cannot import name 'pymbar' from 'pymbar'                                                                                       
 (/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/pymbar/__init__.py)", "traceback": "Traceback (most recent call last):
 File "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval =  
 fun(*args, **kwargs)
  File "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/celery/app/trace.py", line 760, in       
 __protected_call__
    return self.run(*args, **kwargs)
  File                                                                                                    
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/openff/bespokefit/executor/services/optimizer/worker.py", line 63, in 
 optimize
    result = optimizer.optimize(
  File                                                                                                                  
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/openff/bespokefit/optimizers/model.py", line 232, in optimize
       
 cls.prepare(schema, initial_force_field, ".")
  File                                                                                                             
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/openff/bespokefit/optimizers/model.py", line 197, in prepare
        
 cls._prepare(schema, initial_force_field, root_directory)
  File                                                                                                   
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/openff/bespokefit/optimizers/forcebalance/forcebalance.py", line 95,  
 in _prepare
    ForceBalanceInputFactory.generate(root_directory, schema, initial_force_field)
  File                                                             
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/openff/bespokefit/optimizers/forcebalance/factories.py", line 710, in 
 generate
    target_sections.append(target_factory.generate(".", target))
  File                                                                                
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/openff/bespokefit/optimizers/forcebalance/factories.py", line 257, in 
 generate
    cls._generate_target(target, target_records)
  File                                                                                                  
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/openff/bespokefit/optimizers/forcebalance/factories.py", line 368, in 
 _generate_target
    super(TorsionProfileTargetFactory, cls)._generate_target(target, qc_records)
  File                                                          
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/openff/bespokefit/optimizers/forcebalance/factories.py", line 276, in 
 _generate_target
    from forcebalance.molecule import Molecule as FBMolecule
  File                                                                              
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/forcebalance/__init__.py", line 135, in <module>
    from . import   
 parser, forcefield, optimizer, objective, output
  File                                                                                                            
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/forcebalance/forcefield.py", line 107, in <module>
    from          
 forcebalance import gmxio, qchemio, tinkerio, custom_io, openmmio, amberio, psi4io, smirnoffio
  File                                                              
 "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/forcebalance/gmxio.py", line 22, in <module>
    from                
 forcebalance.liquid import Liquid
  File "/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/forcebalance/liquid.py",    
 line 27, in <module>
    from pymbar import pymbar
ImportError: cannot import name 'pymbar' from 'pymbar'                                                         
 (/exs/shared/collaboration/teams/mdteam/private/envs/bespokefit/lib/python3.8/site-packages/pymbar/__init__.py)

Software versions

  • Which operating system and version are you using? Linux
  • How did you install BespokeFit? conda
  • Are you using Apple Silicon? If so, are you running BespokeFit in Rosetta (osx-64) or natively (osx-arm64)?
@j-wags
Copy link
Member

j-wags commented Jul 6, 2023

Hi @xiki-tempula,

We've tried to get around this by having ForceBalance 1.9.5 pin to pymbar<4 and BespokeFit 0.2.2 pin to ForceBalance 1.9.5. Could you give more detail about how you installed the environment?

@j-wags
Copy link
Member

j-wags commented Jul 6, 2023

Oh, my mistake, I see you did put your install instructions - By requiring pymbar=4, you're causing the solver to pull in old versions of everything else. If you drop the version constraint on pymbar you should get a working build.

The pymbar compatibility issue is tracked at leeping/forcebalance#260

@xiki-tempula
Copy link
Author

I see. Thanks. I got some other package that relies on pymabr 4, so when I create a conda environment that pins pymbar to 4. It pulls in the old version 0.1.3. I guess I have to create two enviornment for them then.

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

2 participants