Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Lanking
    @lanking520
    Nope, I use the virtualenv Python instead, just don't want it messed up local environment. I am trying to use polynote along with my demo on Spark and provide instruction for users to start using it. Using Docker although would work but I am looking for some out-of-box solution for users so they don't have to dive into configuration... Also my application will also use GPU, I am not sure if the docker env will have CUDA driver
    btw:
    (env) 3c22fb785594:polynote qingla$ xcode-select --install
    xcode-select: error: command line tools are already installed, use "Software Update" to install updates
    (env) 3c22fb785594:polynote qingla$ clang --version
    Apple clang version 11.0.3 (clang-1103.0.32.62)
    Target: x86_64-apple-darwin19.6.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    jonathanindig
    @jonathanindig
    What is the output of python --version and python-config --ldflags
    Also, what command are you running to get that error? pip install jep ?
    Lanking
    @lanking520
    Here you go
    (env) 3c22fb785594:polynote qingla$ python --version
    Python 3.7.3
    (env) 3c22fb785594:polynote qingla$ python-config --ldflags
    -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -ldl -framework CoreFoundation
    Yes, pip install jep failed
    jonathanindig
    @jonathanindig
    and pip --version ?
    Lanking
    @lanking520
    (env) 3c22fb785594:polynote qingla$ pip --version
    pip 19.0.3 from /Users/qingla/Documents/GitHub/polynote/env/lib/python3.7/site-packages/pip (python 3.7)
    Lanking
    @lanking520
    It seemed there is a mismatch on my python-config which is using python2.7... And it mayu cause the issues while jep trying to find python3.7m package
    jonathanindig
    @jonathanindig
    That’s possible, but the ld warning you posted above seemed to be looking for a python 3 path. I wonder where it got /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib
    Lanking
    @lanking520
    ls /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib
    ls: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib: No such file or directory
    jonathanindig
    @jonathanindig
    Hmm, I don’t really know much about the Python build environment unfortunately. Maybe try python3-config --ldflags?
    My guess is there are two different python installations around that are confusing things
    one of them is no longer there (maybe partially deleted, given the missing directory)
    I’d try reinstalling Python, maybe from homebrew
    or fixing your PATH, in case there are multiple installations there
    maybe your python3-config is from a different python installation than your python? which python3-config and which python should point to the same directory
    for example, on my machine they are both in /usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/bin/
    (I installed python with homebrew)
    João Costa
    @JD557

    Nope, I use the virtualenv Python instead, just don't want it messed up local environment. I am trying to use polynote along with my demo on Spark and provide instruction for users to start using it. Using Docker although would work but I am looking for some out-of-box solution for users so they don't have to dive into configuration... Also my application will also use GPU, I am not sure if the docker env will have CUDA driver

    yeah... the polynote docker image doesn't support CUDA... I think it's not that hard to build an image that works with CUDA, though (I have a WIP, but my nVidia GPU is on my Windows machine, and getting docker to play well with GPU's in windows is not trivial, so I gave up)

    Lanking
    @lanking520
    @jonathanindig thanks for your help! suprisingly, I didn't have python3-config
    python3-config --ldflags
    -bash: python3-config: command not found
    jonathanindig
    @jonathanindig
    maybe it’s not on your PATH? you might find it in your python installation folder (location of which python, if it’s symlinked make sure to follow them to the actual directory)
    Lanking
    @lanking520
    Thanks for you all, I got my issue fixed: installing python3 on my laptop. the system default python3 seemed not working well: after following the brew install python3 instruction I managed to fix it: https://stackoverflow.com/questions/49704364/make-python3-as-my-default-python-on-mac
    jonathanindig
    @jonathanindig
    Awesome, glad to hear it :smile:
    Lanking
    @lanking520
    Something more to follow up. Is there anyway I can use standalone Scala without importing python dependencies for polynote (if I just need scala)
    jeremyrsmith
    @jeremyrsmith
    @lanking520 you can just use Scala and python stuff shouldn't even be initialized at all... if you mean "can I install it with no python" then I think it ought to be possible except that the run script is itself python. If you start it directly with java then I don't see why it wouldn't work (though I haven't tried)
    Lanking
    @lanking520
    @jeremyrsmith Good to know. So another option is simply java -jar on the package and it should work
    So I didn't even have to install the python dependencies
    jeremyrsmith
    @jeremyrsmith
    @lanking520 it's good for us to know that we need an easy way of running Polynote for people who don't plan to use Python... maybe Python itself ought to be a plug-in 🤔 (not sure if that's possible without making jep nonsense way more complicated though)
    Lanking
    @lanking520
    So here is the thing, I am one of the author of https://github.com/aws-samples/d2l-java this project to allow all Java developers to learn DL in Java. We already onboard with Jupyter Notebook and did several hacks to allow Java runs everywhere within Jupyter Notebook. However, the notebook itself lacks of language feature, such as poping up recommendation functions or help on the grammer issues. I found this project truly helpful to help people leverage Scala. So as a start, I planned to create a short tutorial on Spark with Scala for Deep Learning with PolyNote to see how things goes.
    jonathanindig
    @jonathanindig
    That sounds great! It would be great to see the tutorial once it’s ready :D
    As for running directly without python dependencies, like @jeremyrsmith said, the run script https://github.com/polynote/polynote/blob/master/scripts/polynote.py builds a java command that lets you run Polynote. If you don’t need Python support, you can just take a look at the output of the script once and then use that to run it next time.
    Lanking
    @lanking520
    For sure, I will try to build some shell script that can do similar stuff and launch the project
    Lanking
    @lanking520
    QQ: is there any way we can add scalacOptions += "-target:jvm-1.8" since the package I imported require 1.8 features
    And this works perfectly
    #!/usr/bin/env bash
    # Standalone Scala usage for PolyNote
    
    jars="polynote.jar"
    
    for f in deps/*.jar
    do
        jars+=":$f"
    done
    
    java -cp $jars polynote.Main
    jeremyrsmith
    @jeremyrsmith
    Oh, like for the interpreter's compiler? Yeah, we definitely need to be able to pass compiler flags into there! I feel like we had some way to do this but I can't remember what it was... PR would be welcome for this though, even if it's something simple/non-configurable to start with
    (I feel like things like that are OK to start out as like env variables or server arguments, and then can grow into having UI around them... I don't want to stall useful features based on making UI around them)
    (or, even config file elements. That's not too bad and doesn't require UI around it)
    TBH I think -target:jvm-1.8 probably ought to be there by default in the non-spark case, because even without Spark I think we still require JVM 1.8+
    (still PR welcome :grimacing: )
    Lanking
    @lanking520
    Scala will by default using jvm-1.7 which is the minimum support for 2.11. Some packages in Java require 1.8 so we need to add the ScalacOptions to compile and run the package
    Do you know if there is any places I can try to inject this flag and test? I can try to build from source and see if it works. If PolyNote require Java8 and above, I think it is worthwhile to add this compiler flag
    This is the error thrown:
    Error:Static methods in interface require -target:jvm-1.8 (Line 1)
    Lanking
    @lanking520
    Java (from 1.8) start supporting static and default interface methods
    Lanking
    @lanking520
    jeremyrsmith
    @jeremyrsmith
    I think it's fair to say that polynote requires Java 8 or above. We certainly don't test it with anything < Java 8. The first thing I would do here is add a notebook config option for "extra scalac flags" (probably called scalacOptions to align with sbt) that gets parsed into scala.tools.nsc.settings.ScalaSettings (there is a method to do this somewhere...) and gets applied to the default Settings in the ScalaInterpreter
    At some point we could also add a UI to edit that, or maybe even a fancy UI for those settings like IntelliJ has (with checkboxes for common things and whatnot)
    Actually, maybe just adding -target:jvm-1.8 as a default setting would be a fine first step.