How to view my computer folders in ipython? - python

When I open the Ipython dashboard in my browser it opens the folder that I selected as the default local folder for ipython. However, it is not showing any of the subfolders and ipynb files that are inside that local folder.
How can I view this local folder and all of the subfolders in my Dashboard?
I have tried..
ipython notebook --notebook-dir=
creating a profile
I know there is a way since I made it work a long time ago in another computer. I just don't remember the code that I used.
I'm working in Linux Mint 17 computer. Python 2.7. I don't know what other information I should give

Related

.ipynb files visible in Jupyter but not from Windows File Explorer

I'm able to see my .ipynb files when using Jupyter (installed through Anaconda), but I just can't see them in my Desktop or wherever they're saved when using Windows File Explorer. What could cause this and how can I locate the files?
Here is what I mean:
Windows File Explorer
Jupyter
I was having the same problem has you, my solution download the file through jupyter.
File -> Download.
I still can't understand the reason why but after I downloaded the file from the same folder into the same folder it start appearing in my windows explorer folder
I had the same problem as you but realized that it was just a minor thing.
For me, I had installed Anaconda only for the current user. So it was using "C:\Users\username\Desktop" and not "C:\Users\Public\Desktop". The latter is the usual Desktop that is referred to as "This PC\Desktop".
Try looking into "C:\Users\username\Desktop".

VSCode python not finding relitive files in Windows Subsystem for Linux

I'm following the Practical Python Programming course from David Beazley. Having recently switched machines (Ubuntu to Windows 10...i know...) I'm picking this back up.
Environment: Visual Studio Code, using Windows Subsystem for Linux (WSL) running Ubuntu, all the necessary VSCode extentions applied to work with WSL.
Context: python allows you to reference files with code like the below (adapted from the course linked to above). In this case my python module is in a parent directory called Work, and within it there is a directory called Data that has various files in it.
read_data('Data/portfolio.csv', 'Data/prices.csv')
With WSL, you can launch VSCode by doing code . and hitting enter in a Windows Terminal once you are in the directory with a file you want to edit. In my case, doing so in my Work directory (on Ubuntu WSL) starts VSCode and I can run a python file, and as I would expect, I can find the files in the Data/ directory (to be clear, the read_data(... function works).
Issue: if I come into WSL via the Windows GIU first (i.e. clicking the shortcut on my Windows 10 desktop), navigate to the folder on WSL with my code, and run the same file...I get python errors to say it can't find the files I'm referencing. My fix is to reference the full file path.
Why would this be? I've noticed if I do a print Path.cwd() using pathlib while running the file as described above in "Issue" then the working directory is my Ubuntu home, not the directory where the code is.
Is there an interpreter setting or config in VSCode I'm missing?

Cannot Create an Interpreter in PyCharm

I downloaded Python 3.8.
I downloaded PyCharm Community Edition 2019.3.4. Saved it in new folder in the Desktop directory.
In PyCharm, when I click on File > New Project, I...
1.) Have the location set to C:\Users\User\Desktop\newProject
2.) Have New environment using set to Virtualenv
3.) Have Base interpreter set to C:\ProgramFiles\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64_qbz5n2kfra8p0\python.exe
I have a Windows 10 Home computer
When I click on the Create button, I get the attached error.
What can I do?
The error says it has access problem while accessing python.exe. Files inside WindowsApps are for systems use and cannot be accessed manually by users due to access permission.
Also you installation does not seem right as python.exe is present inside WindowsApps.
Please follow the simple installation guide for python. You might run into many other problems later.
I would suggest reinstalling python. It should go directly into C:/ drive or C:/ProgramFiles.

How to get Python files to open into existing Spyder IDE Session

I have been using Spyder via Anaconda for some time, and it has always worked that when I double click on a python file it would open up the code into a new tab in my existing Spyder session. This is on Windows, btw.
I tried a different IDE, Canopy, and it was really awful so I uninstalled it, but somehow in that process I cant get Spyder to get synced back up with my .py files.
When I double click on a .py file, with an existing Spyder session, it will boot up a brand new Spyder session every single time, and it will have an empty black Windows window as well. Neither of these two things was happening to me before I tried out the new IDE.
How can I get back to my .py files opening up into my existing Spyder session? I have tried:
making sure 'Use single instance' was enabled in Spyder.
Changing the default app to spyder.exe that is within the Anaconda/Scripts folder
Changing the default app to both python.exe and pythonw.exe in the Anaconda folder

How to open ipynb files into browser by double-click

Previously, I had Canopy installed and at that time, I could simply double click on ipynb files and open them into the browser.
However, later I needed Anaconda and once I installed it, this feature was gone.
Now I just want to be able to simply double click on ipynb files and the file gets open into the Firefox. Is it possible?
I read about this:
nbopen
pip install nbopen
python -m nbopen.install_win
But it didn't solve my problem. I appreciate any help.
Yes, this is possible. Running python -m nbopen.install_win installs the executable nbopen.exe in the Scripts folder of your anaconda directory. For me this is:
PS> (gcm nbopen).Path
E:\Programs\anaconda\Scripts\nbopen.exe
The first line gets the path of the nbopen command (using PowerShell). If you are not using PowerShell you can find your conda directory by right-clicking on any (I)Python executable in your start menu and look at where it links to.
You can then associate the nbopen.exe file with the .ipynb filetype:
Right-click on a .ipynb file.
Click on Properties
Click on the Change button next to "Open With:"
Click on Browse, browse to the path you found out and select nbopen.exe.
Double-clicking on .ipynb files now checks if a notebook server is running and opens the notebook. If no server is running, one is started in the active directory.
Checkout this Firefox plugin. Python Notebook Viewer.
This plugin lets you view/render python notebooks without running notebook server. Once installed, set Firefox as default app to open ipynb files. From now onwards, you can simply open ipynb files by simply double clicking on it!
This saves a lot of time as most of the time developers are just keen on seeing a code. It also saves a hassle of browsing directories in Jupyter Notebook window to reach to a specific file.
If m00am's solution doesn't work and nbopen.exe file doesn't show up then do the following:
Uninstall Anaconda.
Install Anaconda again and make sure you add Anaconda to Windows path during the installation.
Then try m00am's solution again.
This worked for me:)

Categories