Pycharm Terminal opens Canopy - terminal

I have installed both PyCharm and Canopy at my computer. When I try to run a .py file from the terminal of the PyCharm then it opens the file in the Canopy Editor. What I have tried is:
Settings->Console->Python Console-> Change the intepreter
but didn't work. Does anyone has a clue how to fix it?

Related

What is the shortcut to open RStudio from Anaconda Prompt?

I am having trouble finding the shortcut call to open RStudio from the Anaconda Prompt. Does anyone know what to type?
For example, to open up VSCode you type into the anaconda prompt "code," and the VSCode ide is opened up rather quickly. Is there a similar call for RStudio?

How to solve [WinError 5] Access is denied in anaconda prompt

I have recently reset my laptop and installed Anaconda in it, and I tried to open JupyterLab but it gives me error
Error executing Jupyter command 'lab': [WinError 5] Access is denied
but it works fine when I try to open JUPYTER NOTEBOOK or try to open JUPYTER LAB with Anaconda as administrator.
I reinstalled Anaconda, and still it gives me the same error. Also it gives me the same error when I try to open JUPYTER LAB from Anaconda Navigator. Before resting my laptop it works fine for me, but now it's not. I tried to search my query on the web before asking here, but I did not get my answer.
I want to run JUPYTER LAB with normal Anaconda prompt
Additional details
My Anaconda is installed in C:\ProgramData (by default).
I didn't check the box “add to path” while installing Anaconda.
You can just run it with Python:
python -m jupyterlab
This should work from an Anaconda Prompt or even the command prompt (if it uses the Python in Anaconda). It does not require admin rights.
Workaround:
open anaconda navigator
click on the jupyter lab settings option and then remove it
Now open your anaconda prompt and type the following command: conda install -c conda-forge jupyterlab
now try to open it.
Proper solution:
If you have installed Anaconda for all users then you will face this issue (thanks to Alok Rajasukumaran, who pointed out this). The best way to solve this problem would be to reinstall this for only the current user.
But if you have a requirement to install for all users, then you can follow these steps:
run the terminal as an administrator
type jupyter lab
Optional (Automating launching jupyter lab with shortcut)
If you want to automate these steps, then you can create a batch file and assign a keyboard shortcut to it. Steps are as follows:
open notepad and write "jupyter lab" and save it as a .bat file
right-click on that file and click on create shortcut.
now open the properties of created shortcut file and in the "shortcut-key" section type any combination of keys you want to set
shortcut.
click on "Advanced" and select "Run as administrator"
Now you can initiate jupyter lab directly by typing your shortcut key and giving "yes" permission to the prompt.
Try to execute as an admin. Problem solved.
This solution is unsafe. When you execute a program with Admin this program has full permissions over the system.
The good solution is to create a new environment with your current system user (not root/admin). Activate this new environment and it would works
Usually, you don't have error in opening jupyter notebook command.
I usually type the jupyter notebook in the path bar in the explorer to open the notebook from that path directly — but as we are having an error in jupyter lab, I was only able to open jupyter notebook from there.
The solution for that is:
Just type jupyter notebook as usual in the command prompt or the path bar in explorer.
As soon as the browser opens automatically, change the URL from:
http://localhost:8888/tree to → http://localhost:8888/lab
Yes, just a one word change. tree → lab and...
Whoo! The jupyter lab is open right there you want it to be!
This is a problem that I see happening for Anaconda 3 installs for all users on Windows. Default (for single user) install seems fine. The permissions are somehow messed up during install. The solution I found is: explorer > right click anaconda3 folder > properties > security > advanced > change permissions > check "replace all child permission entries..." > OK.
This will take a while. After that uninstalling and reinstalling Jupyter Lab worked well.
The problem I had is that it installed the application in users/<your username>/anaconda3/.
To solve this I simply manually moved the folder with its contents to c:/program files/.
Avoid running as Admin due to security concerns. The fastest way is to create a virtual environment and install it there. This is what I did and it did not require any reinstallation of Anaconda or running it as Admin.
in anaconda prompt:
conda create -n myenv python=3.9
conda activate myenv
conda install -c conda-forge jupyterlab
jupyter lab
the last line will launch the jupyter lab.
I want to emphasize what was written only as a comment, because it is easier to find it as an answer than to browse all comments:
If you are using Windows and installed it for all users, you will get this error.
The easiest way is to reinstall Anaconda only for you.
Note: You may uninstall your previous (unsuccessful) installation (for all users) before reinstalling it for only one user (you). But it is possible to do it later, too.
What I did is to create a new environment in Anaconda Navigator. I had the default environment which was root, so I could launch applications only as root.
In the Anaconda Navigator Home screen click on Environments -> Create. Here is the guide to create a new environment https://docs.anaconda.com/anaconda/navigator/tutorials/manage-environments/

iTerm as default terminal for Anaconda

I just installed Anaconda (with GUI) for data science projects. I'm a Mac user and when I launch Jupiter notebook from Anaconda Navigator it runs macOS default terminal. Is there a way to set Anaconda for using iTerm2 as terminal?
If you open iterm2 and go to the toolbar(on the top of the screen), try iTerm2-make iterm2 default term. See if this changes the behavior.
If not and you prefer using iTerm2, you can always open up an iTerm2 window and simply type
jupyter notebook
And you should have a jupyter notebook open in your browser, with the process running in the iTerm2 window.
Based on the default installation of anaconda (and iterm2).
Make sure, iTerm2 is an default term - this probably wont help, but... Do that :D
Open iTerm, navigate in menu on iTerm2 > Make iTerm2 default term
When you open the jupyter for example from anaconda, default terminal launches with the script. The name of this script file should be located at the top, by default it is: /opt/anaconda3/bin/jupyter_mac.command
Navigate to /opt/anaconda3/bin/ folder, or any other one where the command file from previous step is.
from terminal: open /opt/anaconda3/bin/ which will open finder in this destination)
In this folder, locate the jupyter_mac.command file
CMD+I on this file (or right-click and select Get Info)
This will open Information window for this file. Under the accordion, there is a selection of "Open with".
Instead of terminal, select iTerm2
Ideally, click on Change All... button so all the .command files will launch in iTerm

Have WSL shell open to project directory in Windows Visual Studio Code

I have a windows subsystem for Linux Installed on my computer and am using it as the integrated terminal on Visual Studio Code. Every time I open a terminal however, it opens in the root directory rather than the current project directory like other terminals do.
Does anyone know of a fix for this?
I have tried messing with the Cwd of the integrated terminal settings but haven't had any luck.
Try using wsl.exe as the command for shell.
"terminal.integrated.shell.windows": "wsl.exe"
I know that is very late for this answer, but for me it just worked.
I put exactly as above and it launched in my home directory (that is /mnt/d/Users/Adrian).
I have the user setup of VSC, 1.30.1 and launch it from the Desktop shortcut.
After I configured terminal as wsl I go as below:
If I open a cmd windows I can launch it with code . it will launch in Windows home directory.
If move to some other folder (e.g Documents) and launch it with code . the bash will launch to that folder.
Otherwise I can launch it with code D:\Users\Adrian\Documents\VSC and the bash terminal will launch in \mnt\D\Users\Adrian\Documents\VSC
Tested the change both via menu File->Preferences->Settings and with Ctrl+Shift+P (Command Pallete), Terminal: Default Shell.
Tried with bash and wsl.
Maybe you have some other bash installed in the path? (e.g. git bash or MinGW bash?)

Issue Closing Then Reopening Anaconda Prompt After Installation

I just installed Anaconda for Python 2.7 on my laptop running 64 bit windows 8.
Once I finish installing Anaconda I go to open the Anaconda prompt and then I run conda update --all. This runs seemingly fine. When it's done running I close the prompt by hitting the close button in the upper right corner.
The issue comes in when I then go to open a new Anaconda prompt. I go to my start menu and open a new prompt. However, instead of the prompt that opened immediately after installing Anaconda I get a command window with these three lines:
>was unexpected at this time.
PATH > #IF NOT ""=="" #chcp > NUL
PATH >
An error seems to happen when I try to open my Anaconda prompt and then my path gets changed back to my default non-Anaconda command prompt path.
Could someone provide any help with this issue?
Thanks!
Facing the same issue. I have a habit of opening Jupyter notebook through anaconda prompt which I cannot do now. Fortunately, the jupyter notebook is opening through Anaconda navigator. Not sure what will I do to use "conda" commands until this issue is solved
Same issue, except that my installation is already 2 months old, suddenly noticing this today.
Olivier.
Open the anaconda prompt and change the anaconda prompt directory to Anaconda/Scripts and then you can use the conda commands.

Resources