Why does Binder not recognize a requirements.txt file? - jupyter-notebook

I am attempting to load a Jupyter Notebook through mybinder.org. The repository that the Notebook is in includes a requirements.txt file with the content
parsl
because the Notebook uses the parsl library.
When I load the notebook and import the library, execution stops with the error
ModuleNotFoundError: No module named 'parsl'
The requirements.txt file is right there. I have no idea what else to do to get mybinder.org to load the module. What am I missing?

Without seeing the repo you are referring to, one suggestion would be you don't have your requirements.txt where it needs to be. If it isn't in the root directory of the repository, it has to be in a folder named binder, see here.
There is a repo that has parsl working. You can fork the repo from here, or alternatively you use https://github.com/Parsl/parsl-tutorial as a basis to make your own and then add in your notebooks.

Related

Julia: how do I configure IJulia kernel to use specific environment?

I downloaded someone else's project and the structure is as follows:
project/
notebooks/
notebook_a.ipynb
notebook_b.ipynb
library/
Manifest.toml
Project.toml
src/
test/
In the notebooks I would like to import library, and install its dependencies within its own evironment.
Following the sugestions here, I can do
using Pkg
Pkg.activate("../library/")
but I wonder if I could install a kernel that has the project directory specified and automatically activates the library environment. What should I pass to IJulia's installkernel? "--project=..." what?
I use conda regularly and this confused me because I thought that running notebook once the environment is activated in the command line would have the right environment in the notebook, but this was not the case.
IJulia starts its own Julia process and hence is not using environment settings from its master.
By default IJulia sets the environment (Project.toml) from the folder it was started. The most convenient thing would be to move the notebooks folder to be subfolder of library and then just run:
notebook(dir="/path/to/project/library")
If you do not want to change the folder structure you still need to run:
notebook(dir="/path/to/project/notebooks")
Once in the notebook you need to run:
using Pkg
pkg"activate /path/to/project/library"

How do I add a local project to the import path in Julia?

I want to be able to import or using a package that I'm writing in a directory ~/projects/ExamplePkg from my main Julia REPL / from another project or environment.
By ]foo I mean "use the foo command at the Julia Pkg REPL". Type ] at the Julia REPL to enter the Pkg REPL. Use ]help <command name> for more info or check the link below.
Ensure that your package has a Project.toml that gives it a UUID and names it (generate one with ]generate from the Julia REPL or with the PkgTemplates package) and that it is in a git repo with at least one commit including all the relevant files.
Then choose how you would like to use the package.
You probably want to run ]dev ~/projects/ExamplePkg:
If dev is used on a local path, that path to that package is recorded and used when loading that package. The path will be recorded relative to the project file, unless it is given as an absolute path.
If you use dev and you change the dependencies in the dev'd package, then you should probably run ]resolve in all environments that depend on the package.
Or you can run ]add ~/projects/ExamplePkg:
Instead of giving a URL of a git repo to add we could instead have given a local path to a git repo. This works similarly to adding a URL. The local repository will be tracked (at some branch) and updates from that local repo are pulled when packages are updated. Note that changes to files in the local package repository will not immediately be reflected when loading that package. The changes would have to be committed and the packages updated in order to pull in the changes.
In Julia versions <1.4: If you accidentally ]add a package before the git repo is set up correctly then you might get ERROR: GitError(Code:EUNBORNBRANCH, Class:Reference, reference 'refs/heads/master' not found). Unfortunately, Julia will probably have cached the bad repo, and you will need to remove that from ~/.julia/clones/<gibberish>/. You can find the dir to remove with grep: $ grep ExamplePkg ~/.julia/clones/*/config.
Documentation: https://julialang.github.io/Pkg.jl/v1/managing-packages/
you can try
path_to_package = "~/projects/ExamplePkg"
push!(LOAD_PATH,path_to_package)
# then use it, ExamplePkg is the package's name
using ExamplePkg
But you have to run codes above whenever you restart Julia.
reference is Workflow tips-Julia Documentation

Development on KDE platform

I'm interested in learning about kde environment. So I read the contribution page on wiki, git cloned the kompare repo and built it. But an attempt to execute the binary gave me an error saying Could not load our KompareNavigationPart. The console showed the following error about kservice:
> ./kompare
kf5.kxmlgui: cannot find .rc file "kompareui.rc" for component "kompare"
kf5.kservice.services: KMimeTypeTrader: couldn't find service type "Kompare/ViewPart"
Please ensure that the .desktop file for it is installed; then run kbuildsycoca5.
kf5.kxmlgui: cannot find .rc file "kompareui.rc" for component "kompare"
Aborting aboutToFinish handling.
I couldn't find anything about it in the readme or the project wiki. I've installed the kde-development-meta package on arch linux. Can anyone help me get started with development on kde platform?
Short answer: Use "cmake -DCMAKE_INSTALL_PREFIX=/usr" and "make install".
Long answer: It looks like you tried to run from the build directory, but the KDE plugin loader does not look there by default. You could adjust the various path variables to additionally point to your build directory. The variables are mentioned at https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source#Set_up_the_runtime_environment
You can also use "make install" to install to a run-time directory. If you did not change the defaults of cmake via -D option, this will be "/usr/local/", and in this case you also have to adjust the various path variables to include that directory, unless your distribution already configured this for you.

Adding the ibapi library to PYTHONPATH module in Spyder (Python 3.6)

I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Spyder.
What I did so far:
I installed the latest version for Windows from here
I provided the following path to the PYTHONPATH manager in Spyder: C:\TWS API\source\pythonclient\ibapi afterwards I restarted Spyder
When I simply type import ibapi I get the same error message: ModuleNotFoundError: No module named 'ibapi'
What I am doing wrong here and how can I fix this simple error?
I don't use python very much but I'm pretty sure you have to install the ibapi. I never used the PYTHONPATH and mine works fine in Spyder and Jupyter. I'm using Anaconda.
I run the Anaconda prompt (just activates the conda environment) and navigate to the dir C:\TWS API\source\pythonclient and run python setup.py install
Then everything works. I think many python packages need to be installed like this.
note: That's not my install dir, I just copied yours. There may be a problem with a space in the path. Try renaming to C:\TWSAPI\... if you still have a problem.
Note: after python setup.py install, you might need to restart spyder. If doesn't help, then copy the newly-created ibapi folder to:
C:\Users\iuzeri\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
or
C:\Program Files (x86)\Python37-32\Lib\site-packages
copy your ibapi here
C:/ProgramData/Anaconda3/Lib/site-packages/ibapi

What makes "paster addcontent" fail for a package created with Zopeskel template "archetype"?

Here is the situation:
fresh Plone 4.2 buildout
a fresh package created using Zopeskel 2.21.1 with template 'archetype'
and configured in my buildout using mr.developer
Trying to add some content types inside my package fails with:
[ajung#dev1 nva.aktionsmittel]$ bin/paster addcontent
Command 'addcontent' not known (you may need to run setup.py egg_info)
Running setup.py egg_info did not help.
setup.py contains:
setup.py: paster_plugins=["ZopeSkel"]
setup.cfg contains:
[zopeskel]
template = archetype
What is the magic behind the local commands in order to make "paster addcontent" working?
It worked in other contexts as it should?!
ZopeSkel 2 issues
You are following a bad tutorial. Please make sure that
You follow instructions specific here http://collective-docs.readthedocs.org/en/latest/getstarted/paste.html#adding-zopeskel-to-your-buildout - paster command must come from buildout
If you are not following the link above then please give the link to the page whose instructions you are follow and I can burn that page as it contains misleading instructions.
Make sure that paster you are using comes from buildout (from your command line it doesn't seem to be so).
Make sure your egg is registered in buildout correctly in eggs =
section
Make sure your setup.py contains necessary boilerplate http://collective-docs.readthedocs.org/en/latest/getstarted/paste.html#how-paster-local-commands-work (note: example is ZopeSkel 3+)
This is the way to make paster aware of your egg and its dependencies correctly and thus local commands can work.
ZopeSkel 3 issue (seemingly unrelated)
There was a recent change in ZopeSkel, meaning that you if you use ZopeSkel 3+ you need to be in srcfolder when running the command.
See note here:
https://github.com/collective/templer.plone.localcommands/#executing-local-commands
In order for the paster localcommand to run, it must be called from the same directory that contains the .egg-info directory (or a child directory inside it). If pasterns unable to find the .egg-info directory, it cannot run a local command. Paster uses the location of the .egg-info directory to locate setup.cfg, which is then used to determine if any local command entry points are available.
Check to see that you have an .egg-info directory generated inside your package, and that you are invoking paster from the same location or a child folder.

Resources