qiskit-community / qiskit-alt

High-performance Qiskit features backed by Julia. A Python front end to algorithms using Pauli and Fermionic operators implemented in Julia.
Apache License 2.0
13 stars 2 forks source link

mixed virtual environment error should not cause an error when using juliacall #23

Open jlapeyre opened 2 years ago

jlapeyre commented 2 years ago

This command

qiskit_alt.project.ensure_init(compile=True, calljulia='juliacall', depot=True);

Causes this error

  File "/home/quser/.conda/envs/qiskit_alt_env/lib/python3.9/site-packages/julia_project/utils.py", line 90, in get_virtual_env_path
    raise Exception('You are using some mix of virtual, conda and mamba environments, cannot figure out which to use!')
Exception: You are using some mix of virtual, conda and mamba environments, cannot figure out which to use!

The error would be raised by pyjulia if it were not raised here. But, it is not clear that this is a problem for juliacall. I don't know how common the mixed environment is. If someone is experimenting and confused, it seems not too difficult. I saw this error by running tests with different environments in a script, without deactivating environments after using them.

Recommendation: Test whether juliacall tolerates this mixed virtual environment (I think it does) and if so, don't raise this error.