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

Cannot precompile #12

Open
gpgjoe opened this issue Apr 7, 2019 · 15 comments
Open

Cannot precompile #12

gpgjoe opened this issue Apr 7, 2019 · 15 comments

Comments

@gpgjoe
Copy link

gpgjoe commented Apr 7, 2019

This just happened. I ran ] add https://github.com/FluxML/Gym.jl as described on Readme, and then I ran using Gym, and I got this:

julia> using Gym
[ Info: Precompiling Gym [56b9baea-2481-11e9-37ae-75904354ad8c]
┌ Warning: Package Gym does not have Random in its dependencies:
│ - If you have Gym checked out for development and have
│   added Random as a dependency but haven't updated your primary
│   environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with Gym
└ Loading Random into Gym from project dependency, future warnings for Gym are suppressed.
WARNING: local variable N conflicts with a static parameter in Type at .julia/packages/Gym/sJrGC/src/Spaces/tuple-space.jl:13.
ERROR: LoadError: LoadError: LoadError: ArgumentError: Package Gym does not have DataStructures in its dependencies:
- If you have Gym checked out for development and have
  added DataStructures as a dependency but haven't updated your primary
  environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with Gym
Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:836
 [2] include at ./boot.jl:317 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1044
 [4] include at ./sysimg.jl:29 [inlined]
 [5] include(::String) at .julia/packages/Gym/sJrGC/src/Spaces/Space.jl:1
 [6] top-level scope at none:0
 [7] include at ./boot.jl:317 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1044
 [9] include at ./sysimg.jl:29 [inlined]
 [10] include(::String) at .julia/packages/Gym/sJrGC/src/Gym.jl:1
 [11] top-level scope at none:0
 [12] include at ./boot.jl:317 [inlined]
 [13] include_relative(::Module, ::String) at ./loading.jl:1044
 [14] include(::Module, ::String) at ./sysimg.jl:29
 [15] top-level scope at none:2
 [16] eval at ./boot.jl:319 [inlined]
 [17] eval(::Expr) at ./client.jl:393
 [18] top-level scope at ./none:3
in expression starting at .julia/packages/Gym/sJrGC/src/Spaces/dict-space.jl:1
in expression starting at .julia/packages/Gym/sJrGC/src/Spaces/Space.jl:13
in expression starting at .julia/packages/Gym/sJrGC/src/Gym.jl:11
ERROR: Failed to precompile Gym [56b9baea-2481-11e9-37ae-75904354ad8c] to .julia/compiled/v1.0/Gym/Z6zPi.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1203
 [3] _require(::Base.PkgId) at ./loading.jl:960
 [4] require(::Base.PkgId) at ./loading.jl:858
 [5] require(::Module, ::Symbol) at ./loading.jl:853

EDIT:

julia> versioninfo()
Julia Version 1.0.3
Commit 099e826241 (2018-12-18 01:34 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Pentium(R) 3558U @ 1.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)

Let me know if more information would help you.

@v-i-s-h
Copy link

v-i-s-h commented Apr 8, 2019

The problem is the line here: https://github.com/FluxML/Gym.jl/blob/master/src/Spaces/dict-space.jl#L1
uses DataStructures package, but Project.toml file is not updated to include this.

This can be solved by going to repl and do ] add DataStructures and then using Gym.

@tejank10 Maybe this issue should be renamed to reflect the missing dependencies.

Also, there is this warning which also needs to be taken care of

julia> using Gym
[ Info: Recompiling stale cache file /home/vish/.julia/compiled/v1.1/Gym/Z6zPi.ji for Gym [56b9baea-2481-11e9-37ae-75904354ad8c]
┌ Warning: Package Gym does not have Random in its dependencies:
│ - If you have Gym checked out for development and have
│   added Random as a dependency but haven't updated your primary
│   environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with Gym
└ Loading Random into Gym from project dependency, future warnings for Gym are suppressed.

@kraftpunk97-zz
Copy link
Contributor

kraftpunk97-zz commented Apr 8, 2019

@v-i-s-h is it just a matter of dependencies? Updating Project.toml should solve this problem yes?

@v-i-s-h
Copy link

v-i-s-h commented Apr 8, 2019

I think yes. Adding DataStructures and Random to Project.toml should solve this problem.

@kraftpunk97-zz
Copy link
Contributor

@gpgjoe Pinging to verify if the problem has been solved.

@gpgjoe
Copy link
Author

gpgjoe commented Apr 10, 2019

Hey!

Thanks for this.

I'm actually new with Julia. I see that you merged your edits here https://github.com/FluxML/Gym.jl/commit/5ad79762a44d8bbf9e177c1761a7b6af62a584ee. But is there an easy way for me to install this? I've tried ] add https://github.com/FluxML/Gym.jl#5ad79762a44d8bbf9e177c1761a7b6af62a584ee and it seems that Julia understands the command. Pkg says that the installed version is

[56b9baea] Gym v0.1.0 #5ad7976 (https://github.com/FluxML/Gym.jl)

However, when I run using Gym I still get the same error as before. I've tried restarting the REPL.

@gpgjoe
Copy link
Author

gpgjoe commented Apr 10, 2019

My issue aside, there's a typo in there.

5ad7976

In any case, how is it that's working for you?

@kraftpunk97-zz
Copy link
Contributor

@gpgjoe Ah, it's unfortunate that my band aid fix needs a band aid fix of its own; but #15 should get things working smoothly. I believe it is possible for Julia users to install various versions of the same package. Maybe give that a try?

@gpgjoe
Copy link
Author

gpgjoe commented Apr 11, 2019

Installing from your fork worked.

I'm used to Python, and I'm already in love with Julia's package manager.

@kraftpunk97-zz
Copy link
Contributor

@gpgjoe The required changes have been incorporated into the main repository. It'd be better for you to switch to it. Sorry for the unnecessary trouble🙇‍♂️.

@gpgjoe
Copy link
Author

gpgjoe commented Apr 13, 2019

Now I get an error trying to run the example:

using Gym
env = CartPoleEnv()

gives me:

UndefVarError: isnothing not defined
Box(::Array{Float32,1}, ::Array{Float32,1}, ::DataType) at box.jl:39
CartPoleEnv() at CartPole.jl:48
top-level scope at none:0

if isnothing(dtype)

Again, I don't understand how it's possible that I get this error but you can run it fine.

@gpgjoe
Copy link
Author

gpgjoe commented Apr 13, 2019

I think most of the code doesn't really depend on the above. What is the proper way to edit a Julia package? With packages on the main registry I know I can do dev <package name> but as this package has been installed from a repo that doesn't really work (there's a different package named Gym).

@gpgjoe
Copy link
Author

gpgjoe commented Apr 13, 2019

I've tried copying Gym to a separate folder and then restart Julia, run prepend!(LOAD_PATH, ["my_new_folder"]) and that didn't work.

@gpgjoe
Copy link
Author

gpgjoe commented Apr 13, 2019

Right. Wrong version. I was using Julia 1.0.3. Moved to 1.1.0 and it's working now. isnothing didn't exist in 1.0.3.

@anandijain
Copy link

anandijain commented Aug 26, 2019

Is anyone getting a cant precompile for Cairo.jl?

Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
[ Info: Precompiling Gym [56b9baea-2481-11e9-37ae-75904354ad8c]
ERROR: LoadError: Cairo not properly installed. Please run
Pkg.build("Cairo")

Output of Pkg.build("Cairo") :

Building LibCURL  `C:\Users\Anand\.julia\packages\LibCURL\lWJxD\deps\build.log`     
Building WinRPM  `C:\Users\Anand\.julia\packages\WinRPM\Y9QdZ\deps\build.log`      
Building Homebrew → `C:\Users\Anand\.julia\packages\Homebrew\s09IX\deps\build.log`             
Building Cairo → `C:\Users\Anand\.julia\packages\Cairo\CXPG1\deps\build.log`       

New to Julia, not sure what's going on,
Thanks!

===== update =====
After add Cairo and another Pkg.build("Cairo"), I can now call using Gym.

Any ideas why the initial install of Gym (from github), didn't get this?

@kraftpunk97-zz
Copy link
Contributor

@anandijain can't really say that without knowing what cause Cairo's build process to fail the first time. If you have the complete stacktrace, that could be helpful. Although, Cairo.jl has been acting strangely as of late, even on macOS. It is being looked into.

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

4 participants