Skip to content

v1.0 #30

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Isaac-Severinsen opened this issue Sep 19, 2018 · 14 comments
Closed

v1.0 #30

Isaac-Severinsen opened this issue Sep 19, 2018 · 14 comments

Comments

@Isaac-Severinsen
Copy link

Hi,

I'm trying to install diffeqpy for my python installation (Winpython w/ python 3.5.4)

Following the instructions:

  • used pip to install to python with "pip install diffeqpy"

  • downloaded the julia prgram from https://julialang.org/downloads/

  • Installed Julia to: "C:\WinPython\python-3.5.4.amd64\Julia-1.0.0"

  • Added "C:\WinPython\python-3.5.4.amd64\Julia-1.0.0" and "C:\WinPython\python-3.5.4.amd64\Julia-1.0.0\bin" to my path in windows' system variables and user variables

  • Tried to install "DifferentialEquations.jl" and "PyCall.jl" with
    "julia>using Pkg
    julia>Pkg.add("DifferentialEquations")
    julia>Pkg.add("PyCall")"

  • Using Python Interpreter I ran
    ">>> import diffeqpy

diffeqpy.install()"

but got:

">>> import diffeqpy

diffeqpy.install()
ERROR: LoadError: UndefVarError: Pkg not defined
Stacktrace:
[1] top-level scope at none:0
[2] include at .\boot.jl:317 [inlined]
[3] include_relative(::Module, ::String) at .\loading.jl:1038
[4] include(::Module, ::String) at .\sysimg.jl:29
[5] exec_options(::Base.JLOptions) at .\client.jl:229
[6] start() at .\client.jl:421
in expression starting at C:\WinPython\python-3.5.4.amd64\lib\site-packages\diff
eqpy\install.jl:1
Traceback (most recent call last):
File "", line 1, in
File "C:\WinPython\python-3.5.4.amd64\lib\site-packages\diffeqpy_init
.py",
line 33, in install
subprocess.check_call(['julia', os.path.join(script_dir, 'install.jl')])
File "C:\WinPython\python-3.5.4.amd64\lib\subprocess.py", line 271, in check_c
all
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['julia', 'C:\WinPython\python-3.5.4.a
md64\lib\site-packages\diffeqpy\install.jl']' returned non-zero exit status
1
Command '['julia', 'C:\WinPython\python-3.5.4.amd64\lib\site-packages\diffe
qpy\install.jl']' returned non-zero exit status 1

"

I'm not sure if this is an issue with my path or something else.

I've tried checking my installations of PyCall and DifferentialEquations within Julia by using:

"julia> using Pkg

julia> Pkg.installed("PyCall")
ERROR: MethodError: no method matching installed(::String)
Closest candidates are:
installed() at C:\cygwin\home\Administrator\buildbot\worker\package_win64\buil
d\usr\share\julia\stdlib\v1.0\Pkg\src\API.jl:261
Stacktrace:
[1] top-level scope at none:0

julia>"

I'm sorry if this is a very simple issue or does not belong in this forum but I couldn't find much help out there for this installation.

Apologies for poor formatting on github / understanding of Julia, i just want something better than scipy.

Thanks,

Isaac

@dkarrasch
Copy link

I can't help for the bigger issue, but to check your installed packages, you would use Pkg.status() (afterusing Pkg), or, alternatively, pass to the package REPL by typing ], and then type st or status.

@ChrisRackauckas ChrisRackauckas changed the title Installation issues v1.0 Sep 19, 2018
@ChrisRackauckas
Copy link
Member

This repo was setup with Julia v0.6 and hasn't been tested with v1.0 yet. These are v1.0 issues so the title was reflected to be about that.

@Isaac-Severinsen
Copy link
Author

Thanks for the help,

I uninstalled Julia v1.0 and installed v0.6.4, this seemed to fix the majority of the issues, additionally installing the TLS easy fix and Windows management framework.

I've tried to follow the initial instructions on the github page, in python i ran:

"
from diffeqpy import de

def f(u,p,t):
return -u

u0 = 0.5
tspan = (0., 1.)
prob = de.ODEProblem(f, u0, tspan)
sol = de.solve(prob)
"

which gave the error:
"

SystemError Traceback (most recent call last)
in ()
----> 1 from diffeqpy import de
2
3 # def f(u,p,t):
4 # return -u
5

C:\WinPython\python-3.5.4.amd64\lib\site-packages\diffeqpy\de.py in ()
1 from . import setup
----> 2 _jul = setup()
3
4 # Suppress many UndefVarError printed out. pyjulia calls
5 # self.api.jl_call2(self.api.show, stderr, exoc) in

C:\WinPython\python-3.5.4.amd64\lib\site-packages\diffeqpy_init_.py in setup()
13
14 def setup():
---> 15 jul = Julia()
16 include(jul, 'setup.jl')
17

C:\WinPython\python-3.5.4.amd64\lib\site-packages\julia\core.py in init(self, init_julia, jl_runtime_path, jl_init_path, debug)
384 _julia_runtime[0] = self.api
385
--> 386 self.add_module_functions("Base")
387
388 sys.meta_path.append(JuliaImporter(self))

C:\WinPython\python-3.5.4.amd64\lib\site-packages\julia\core.py in add_module_functions(self, module)
389
390 def add_module_functions(self, module):
--> 391 for name, func in iteritems(module_functions(self, module)):
392 setattr(self, name, func)
393

C:\WinPython\python-3.5.4.amd64\lib\site-packages\julia\core.py in module_functions(julia, module)
168 names = julia.eval("names(%s)" % module)
169 for name in names:
--> 170 if (ismacro(name) or
171 isoperator(name) or
172 isprotected(name) or

C:\WinPython\python-3.5.4.amd64\lib\site-packages\julia\core.py in ismacro(name)
119 False
120 """
--> 121 return name.startswith("@")
122
123

SystemError: error return without exception set
"

My feeling is that this is a python version issue?
Or perhaps I should wait until Julia v1.0 is updated to work with this repo?

@ChrisRackauckas
Copy link
Member

It's probably best to hold off for a bit and we'll get this v1.0 ready. It might take a bit of work though.

@homocomputeris
Copy link

Similar issue on Linux:

>>> import diffeqpy
>>> diffeqpy.install()
ERROR: LoadError: UndefVarError: Pkg not defined
Stacktrace:
 [1] top-level scope at none:0
in expression starting at /usr/lib/python3.7/site-packages/diffeqpy/install.jl:1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/diffeqpy/__init__.py", line 33, in install
    subprocess.check_call(['julia', os.path.join(script_dir, 'install.jl')])
  File "/usr/lib/python3.7/subprocess.py", line 328, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['julia', '/usr/lib/python3.7/site-packages/diffeqpy/install.jl']' returned non-zero exit status 1.

@tkf
Copy link
Contributor

tkf commented Oct 9, 2018

As I can see the question is recurring, let me clarify the situation: simple installation of diffeqpy from PyPI would not work with Julia 1.0 (and 0.7) until new PyJulia is released. If you want to get the update, subscribe to: JuliaPy/pyjulia#198

@ChrisRackauckas
Copy link
Member

@tkf has the pyjulia v1.0 update completed? I don't exactly know from JuliaPy/pyjulia#198 (comment)

@tkf
Copy link
Contributor

tkf commented Oct 25, 2018

It's more-or-less ready but there are some remaining tasks: https://github.com/JuliaPy/pyjulia/milestone/1. It's mostly documentation.

@ChrisRackauckas
Copy link
Member

Okay cool. I'm travelling soon but I want to make sure diffeqpy and diffeqr get v1.0 updates soon. I'll give some things a try while on the flights.

@tkf
Copy link
Contributor

tkf commented Oct 26, 2018

BTW, I experimented Julia/Python interface https://tkf.github.io/PyBase.jl/latest/ to automate things like diffeqpy. It kind of works: https://nbviewer.jupyter.org/gist/tkf/ef78c4b625774414974f9d98fbe57026 but I have to fight a lot with PyCall's aggressive auto-conversion which copies Python values to Julia values and vice versa. At this point, my impression is that working on project like diffeqpy would be painful until PyCall provides "lazier" interface wrapper (i.e., doing lesser copy-based conversion).

@Isaac-Severinsen
Copy link
Author

Hi guys,

I'm excited to see pyJulia0.2 is released!,

Does this mean that diffeqpy will now work with Julia v1.0?

@tkf
Copy link
Contributor

tkf commented Nov 7, 2018

Unfortunately, diffeqpy itself can't be used at the moment. But you can get an equivalent environment by:

from julia import Main

Main.eval("""
using DifferentialEquations
using PyCall

PyCall.PyObject(::typeof(DiffEqBase.solve)) =
    PyCall.pyfunctionret(solve,Any,Vararg{PyCall.PyAny})

const inspect = pyimport("inspect")

function DiffEqBase.numargs(f::PyCall.PyObject)
    haskey(f,:py_func) ? _f = f[:py_func] : _f = f
    if PyCall.pyversion < v"3.0.0"
        return length(first(inspect[:getargspec](_f)))
    else
        return length(first(inspect[:getfullargspec](_f)))
    end
end
""")

from julia import DifferentialEquations as de

@ChrisRackauckas
Copy link
Member

Is this fixed? I don't think it is?

@tkf
Copy link
Contributor

tkf commented Nov 13, 2018

ODE and SDE are probably functional (simple examples work). But the tests for DAE and DDE are broken.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants