Torch default directory - torch

I installed Torch using the instructions at http://torch.ch/docs/getting-started.html and it created a directory called ~/torch.
Is it possible for me to rename the default torch directory to ~/.torch, for example?

yes, you can rename it as you wish, but after renaming it, rerun the commands:
./clean.sh
./install.sh

Related

pyinstaller -- No Module Named pyWinhook

Tried removing the part that used pyWinhook from the project, and I got it running.
Anyone know how to fix it ?
Tried hidden import, but did not help..
File "ScreenShot.py", line 1, in
ModuleNotFoundError: No module named 'pyWinhook'
Problem was to do with Swig files, downloaded the swig files and copied it to the python source folders.
you need to install that module using
pip install pyWinhook

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"

Why does Binder not recognize a requirements.txt file?

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.

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

Jupyter notebook custom.css in created environment

Does anyone know how to set custom.css in for a conda environment?
I created a new environment using
conda create -n myenv
But it doesn't use the same custom.css I created in the default environment.
Any idea where I should put the custom.css file to get Jupyter to use it?
I'm using Windows 7.
See the docs here for info on where paths are located by default (for conda you'd probably be looking at the {sys.prefix}/etc/jupyter path).
Or you could just run jupyter --paths in your conda environment shell to find out where it is looking for custom files.

Resources