Cannot start Canopy's IPython from Windows command shell - ipython

I have been using EPD for some time and recently started using Canopy. So now I have both EPD and Canopy installed on my machine, which runs Windows 7 Pro x64. But I just realized I cannot launch Canopy's IPython interactive session (located in the directory C:\Users\User\AppData\Local\Enthought\Canopy\User\Scripts) in a Windows command prompt. I already added this directory to my Path before the EPD's python directory.
I checked out those files in the directory .../Canopy/User/Scripts/, I believe that problem is not with the file "ipython-script.py" there, but with the file "ipython.exe", which is what will be run when I simply type "ipython" in a Windows command shell (I set the path already).
In a Windows command shell, if I changed to the directory .../Canopy/User/Scripts/ and type up "python ipython-script.py", then I can correctly start the IPython session in the command shell. So, it looks like that "ipython.exe" does not run the script "ipython-script.py"...
Has anyone run into this same problem? Is there an easy fix?
P.S. I already had the latest Canopy (version 1.0.1.1160) installed.
Thanks for any help.

If you want to launch web interactive then the command
ipython notebook in windows shell or in canopy shell works.

Related

nvm and gulp found on Visual Code terminal but not on linux terminal

I have Ubuntu LTS 20.04 running on wsl2 in Windows, this way I'm able to compile my JS/React code and run my php server in linux and use windows to code using Visual Studio Code.
This is running great, but a strange thing is happening, I installed nvm and gulp through the Visual Studio Code terminal and if I use them on the terminal it works fine but not if I do it outside the terminal (using Windows terminal), it says not found for both gulp and nvm.
I assume VSCode is adding a few things to the PATH but I don't know what to do for them to be found by the windows terminal (outisde VSCode terminal). Screen below. On the left is the result of running nvm list inside VS Code terminal and on the right on Ubuntu terminal, which can't find.
I'm a bit confused by your question. It sounds like you're installing programs on Windows through the VSCode terminal, and then trying to run them on Windows but it's not working. But then your screenshot shows the WSL Ubuntu prompt failing to find the command. Assuming you want to run these under WSL, log in to WSL Ubuntu and run this:
find / -name nvm
If you actually want to use the Windows terminal to run the program, you'll have to find where it is installed in Windows and make sure that's in your %PATH% but this doesn't seem like it's what you're trying to do.
The correct answer was provided by the comment from MindSwipe.
On VSCODE terminal if I "echo $PATH" it has the nvm directory in it while the $PATH on WSL doesn't, I assume VSCODE alters its own terminal PATH when the tools are installed using it instead of the global WSL path.
I've changed the WSL path and it's now working, how can I present the bounty to MindSwipe ?

cannot open .ipynb file even if ipython and jupyter is installed in my pc

I have installed ipython, jupyter etc using pip in my windows 7 pc. Now I want to open a .pynb file from command line. When I typed 'jupyter notebook' it is showing: 'jupyter' is not a recognized internal or external command ...... Can you tell where is the problem? Can't I open the file from command line or I have to install an IDE like 'pycharm' or 'anaconda'?
Please try the below command:
python -m notebook
This should work without anaconda.

start ubuntu as terminal in project folder

I added the following line to my settings in VSCode:
"terminal.integrated.shell.windows": "C:\\Users\\bd\\AppData\\Local\\Microsoft\\WindowsApps\\ubuntu.exe"
When I now start a terminal ubuntu is started in my user's home folder. How is it possible to start ubuntu in the project folder?
The thing is wsl can start any linux that I set using wsl /setdefault I dont like to rely on such a setting but want to specify the one I want to start. I want it started in the project's folder.
Edit:
I change into some project directory and call wslconfig.exe /s Legacy. When I now invoke wsl Bash is started in the current folder.
I return to cmd and call wslconfig.exe /s Ubuntu. When I now call wsl Store Ubuntu is started in the current folder.
wsl.exe seems to start Ubuntu differently than ubuntu.exe does. ubuntu.exe always starts in the user's home dir.
I assume that what you want to run in the VSCode terminal is the Windows Subsystem for Linux (in particular the Ubuntu variant).
To do so, you should run wsl.exe, using this setting:
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\wsl.exe",
This will start up a Windows Subsystem for Linux shell inside the terminal. If you have installed Ubuntu, that is what will be run.

cant run python scripts without typing "python" in windows comand prompt after installing Enthought Canopy

I used to have Enthought EPD, and I upgraded to Enthought Canopy on windows 7. My python program my_program.py wont run without typing python ("python my_program.py") in the command prompt, where before the upgrade I could run in just by typing "my_program.py".
Thanks,
Ron
You have to write the below code in your script
#!/usr/bin/env python

Enthought Canopy ipython configuration: bad interpreter No such file or directory

I'm trying to launch Enthought Canopy's ipython from a Terminal in Mac OS 10.8.3 using the following command:
/Applications/Canopy.app/appdata/canopy-1.0.0.1160.macosx-x86_64/Canopy.app/Contents/bin/ipython
but I'm receiving the following error:
/Applications/Canopy.app/appdata/canopy-1.0.0.1160.macosx-x86_64/Canopy.app/Contents/bin/ipython: /Library/Frameworks/Python.framework/Versions/7.1/Resources/Python.app/Content: bad interpreter: No such file or directory
This (7.1) framework was previously installed but was removed long ago, so I can't quite figure out where Canopy's IPython is getting this link from. I've checked my ./ipython/profile_default directory as well but this didn't help.
Any idea how I might be able to launch ipython from a Terminal?
Thanks!
Canopy uses virtual environments to setup a user environment which is isolated from the environment in which the app itself is running. This prevents any changes made to the environment, by the user, from crashing the application itself.
To run an IPython terminal, with access to any packages that you may have installed via the package manager, you should run IPython from the User environment -- ~/Library/Enthought/Canopy_64bit/User/bin/ipython