Giter Club home page Giter Club logo

Comments (6)

stevengj avatar stevengj commented on June 16, 2024

The no module named site message usually means that some Python path is getting set incorrectly. Could be related to JuliaPy/PyCall.jl#57 ... cc @lucasb-eyer

from pyplot.jl.

AntonioSaragga avatar AntonioSaragga commented on June 16, 2024

Thanks for your quick reply. The problem is indeed in PyCall.jl. Reversing the recent commit and reinstalling

push!(libpaths, exec_prefix)
    if !haskey(ENV, "PYTHONHOME")
        ENV["PYTHONHOME"] = exec_prefix
    end

the issue disappeared and got my plots back

from pyplot.jl.

stevengj avatar stevengj commented on June 16, 2024

So the problem is using prefix * ":" * exec_prefix instead of exec_prefix for PYTHONHOME? Maybe Windows wants ; as the path separator?

What if you re-instate the patch but use

ENV["PYTHONHOME"] = prefix * (@windows? ";" : ":") * exec_prefix

from pyplot.jl.

lucasb-eyer avatar lucasb-eyer commented on June 16, 2024

That is very possible. I thought about it when writing the pull-request, but since the PYTHONHOME documentation explicitly gave only : as an example while the very next documented variable (PYTHONPATH) goes lengths about explaining that one should use os.pathsep, I assumed PYTHONHOME to be colon-only. I didn't have a windows installation handy to test.

Another possibility is that one shouldn't set it to both prefix and exec_prefix on windows, but that's less likely.

from pyplot.jl.

AntonioSaragga avatar AntonioSaragga commented on June 16, 2024

Believe that it is the second possibility, since with ENV["PYTHONHOME"] = prefix * (@windows? ";" : ":") * exec_prefix one gets

PyError (PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError('No module named matplotlib',)

at C:\Users\Tony\.julia\PyPlot\src\PyPlot.jl:32
at In[1]:2
 in pyerr_check at C:\Users\Tony\.julia\PyCall\src\exception.jl:58

and Python docs state that "prefix and exec-prefix stand for the directories that Python is installed to... They are always the same under Windows"

The following

ENV["PYTHONHOME"] =  (@windows? exec_prefix : (prefix * ":" * exec_prefix ))

works fine on Windows

from pyplot.jl.

stevengj avatar stevengj commented on June 16, 2024

Should be fixed in the latest PyCall.

from pyplot.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.