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

PythonCall can not import the package that is installed by CondaPkg #445

Closed
shayandavoodii opened this issue Jan 27, 2024 · 1 comment
Closed
Labels
question Further information is requested

Comments

@shayandavoodii
Copy link

shayandavoodii commented Jan 27, 2024

I've installed stumpy package using CondaPkg. When I want to import it using the pyimport function, I get the following error:

ERROR: Python: ModuleNotFoundError: No module named 'stumpy'
Python stacktrace: none
Stacktrace:
 [1] pythrow()
   @ PythonCall C:\Users\Shayan\.julia\packages\PythonCall\wXfah\src\err.jl:94
 [2] errcheck
   @ PythonCall C:\Users\Shayan\.julia\packages\PythonCall\wXfah\src\err.jl:10 [inlined]
 [3] pyimport(m::String)
   @ PythonCall C:\Users\Shayan\.julia\packages\PythonCall\wXfah\src\concrete\import.jl:11
 [4] top-level scope
   @ REPL[2]:1

Further details:

julia> using PythonCall

julia> pyimport("stumpy")
ERROR: Python: ModuleNotFoundError: No module named 'stumpy'
Python stacktrace: none
Stacktrace:
 [1] pythrow()
   @ PythonCall C:\Users\Shayan\.julia\packages\PythonCall\wXfah\src\err.jl:94
 [2] errcheck
   @ PythonCall C:\Users\Shayan\.julia\packages\PythonCall\wXfah\src\err.jl:10 [inlined]
 [3] pyimport(m::String)
   @ PythonCall C:\Users\Shayan\.julia\packages\PythonCall\wXfah\src\concrete\import.jl:11
 [4] top-level scope
   @ REPL[2]:1

julia> using CondaPkg

(@v1.10) pkg> conda status
CondaPkg Status C:\Users\Shayan\.julia\environments\v1.10\CondaPkg.toml
Environment
  C:\Users\Shayan\.julia\environments\v1.10\.CondaPkg\env
Packages
  stumpy v1.12.0 (channel=conda-forge)

julia> CondaPkg.envdir()
"C:\\Users\\Shayan\\.julia\\environments\\v1.10\\.CondaPkg\\env"

(@v1.10) pkg> st CondaPkg PythonCall
Status `C:\Users\Shayan\.julia\environments\v1.10\Project.toml`
  [992eb4ea] CondaPkg v0.2.22
  [6099a3de] PythonCall v0.9.15

On Python side:

(C:\Users\Shayan\.julia\environments\v1.10\.CondaPkg\env) C:\Users\Shayan\.julia\environments\v1.10\.CondaPkg\env>conda
list
# packages in environment at C:\Users\Shayan\.julia\environments\v1.10\.CondaPkg\env:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.8                hcfcfb64_5    conda-forge
ca-certificates           2023.11.17           h56e8100_0    conda-forge
intel-openmp              2024.0.0         h57928b3_49841    conda-forge
libblas                   3.9.0              21_win64_mkl    conda-forge
libcblas                  3.9.0              21_win64_mkl    conda-forge
libexpat                  2.5.0                h63175ca_1    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libhwloc                  2.9.3           default_haede6df_1009    conda-forge
libiconv                  1.17                 hcfcfb64_2    conda-forge
liblapack                 3.9.0              21_win64_mkl    conda-forge
libsqlite                 3.44.2               hcfcfb64_0    conda-forge
libxml2                   2.12.4               hc3477c8_1    conda-forge
libzlib                   1.2.13               hcfcfb64_5    conda-forge
llvmlite                  0.41.1          py311h5bc0dda_0    conda-forge
mkl                       2024.0.0         h66d3029_49657    conda-forge
numba                     0.58.1          py311h2c0921f_0    conda-forge
numpy                     1.26.3          py311h0b4df5a_0    conda-forge
openssl                   3.2.0                hcfcfb64_1    conda-forge
pip                       23.3.2             pyhd8ed1ab_0    conda-forge
pthreads-win32            2.9.1                hfa6e2cd_3    conda-forge
python                    3.11.7          h2628c8c_1_cpython    conda-forge
python_abi                3.11                    4_cp311    conda-forge
scipy                     1.12.0          py311h0b4df5a_2    conda-forge
setuptools                69.0.3             pyhd8ed1ab_0    conda-forge
stumpy                    1.12.0             pyhd8ed1ab_0    conda-forge
tbb                       2021.11.0            h91493d7_1    conda-forge
tk                        8.6.13               h5226925_1    conda-forge
tzdata                    2023d                h0c530f3_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
vc                        14.3                hcf57466_18    conda-forge
vc14_runtime              14.38.33130         h82b7239_18    conda-forge
vs2015_runtime            14.38.33130         hcb4865c_18    conda-forge
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge

(C:\Users\Shayan\.julia\environments\v1.10\.CondaPkg\env) C:\Users\Shayan\.julia\environments\v1.10\.CondaPkg\env>python

Python 3.11.7 | packaged by conda-forge | (main, Dec 23 2023, 14:27:59) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import stumpy
>>>

So I think there is an issue with PythonCall.

@shayandavoodii shayandavoodii added the question Further information is requested label Jan 27, 2024
@shayandavoodii
Copy link
Author

I've set the wrong path for the ENV["JULIA_PYTHONCALL_EXE"] variable:
ENV["JULIA_PYTHONCALL_EXE"] = raw"C:\Users\Shayan\AppData\Local\Programs\Python\Python310\python.exe". I changed it to ENV["JULIA_PYTHONCALL_EXE"] = raw"C:\Users\Shayan\.julia\environments\v1.10\.CondaPkg\env\python.exe" and now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant