jupyter notebook default folder won't change - python-2.7

I tried changing the start in field of the shortcut, and I created the the config.py file and wrote c.NotebookApp.notebook_dir = u'D:\Jupyter' and made sure it's uncommented.
Note that when I open Jupyter Notebook from the Anaconda prompt it does open in the desired folder. I'm trying to make it work with the shortcut.
This picture shows the properties of the shortcut and the relevant part of the config.py, as well as showing the Jupyter Notebook virtual server is attached.
I consulted the following link before posting my question
(not hyperlinked due to lack of reputation):
https://www.reddit.com/r/IPython/comments/44luwc/how_to_change_jupyter_start_folder/
http://jupyter-notebook.readthedocs.io/en/latest/config.html
Changing Jupyter Notebook start up folder by modifying "start in" not working any more
Jupyter Notebook Set Default Folder to Root
jupyter notebook starting directory

Try to remove the u before your path.
I've run Anaconda and Jupyter on several Windows environments, and my path has always worked, but I've never used the Unicode modifier. I don't believe it's needed. So try:
c.NotebookApp.notebook_dir = 'D:\\Jupyter'
The double \ is needed to escape the character

Step 1: Browse to the Jupyter Notebook file location and open the configuration file in Notepad:
C:\Users\username\.jupyter\jupyter_notebook_config.py
Step 2: Search for the following line in the file:
#c.NotebookApp.notebook_dir = ''
And replace it with:
c.NotebookApp.notebook_dir = 'C:/the/path of/folder/where you/want to set/'
Step 3: Finally, go to where your shortcut to the Jupyter Notebook is located; e.g.:
C:\Users\User_name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)
And do the following:
Go to the Properties of Jupyter Notebook link.
In the Target field, remove %USERPROFILE%, as #stenlytw suggested above.
Then, in the Start in field, type the same directory you set above:
C:\path of folder\where you\want to set\in jupyter_notebook_config.py
Just remember! In the notebook_config.py file, the path is enclosed within apostrophes ('…'), and uses a forward slash (/) as the directory delimiter—but in properties, you don't use the apostrophes, and instead use a backslash (\).

Here's an altenative which I have not seen anyone mentioned anywhere:
Keep the default directories all the same and simply create a bookmark in your browser.
For example, my python code is at C:\Users[name]\Documents\Code\Python, so I have a bookmark for "http://localhost:8888/tree/Documents/Code/Python" in my toolbar.
As soon as Jupyter opens a tab in your browser, hit the button. It requires one extra click, yes, but saves you from some possibly annoying tinkering, and allows you to create multiple such bookmarks!
Note: If I open Jupyter in a 2nd environment, I would need the same link but with 8889 (instead of 8888)

Related

Google Colab is telling me that a path to a video input is not set when it clearly is set correctly

I am using google colab GPU to run an open source vehicle counting system on the darknet/yolov3 framework. I was able to get yolov3 running perfectly for video object detection. I cannot get this second repository to run and I think it is a google colab issue because I am new to it. Ivy-master and darknet-master are cloned under content, I also tried saving these in drive but it did not make a difference.
I have my .env file set up as vars.env and installed the colab-env. When I run !python -m main in colab, I get the error Path to video or camera input not set. My variable in my vars.env file looks like so:
VIDEO="./content/vehiclesystem/data/demodata/videos/sample.mp4". The path is correct, so why is colab telling me the path is not set? I have tried asking owner for help but no luck.
I think the path should not contain the . (dot). But for certain results, try to go to the files panel on the left side and find the path by right-clicking the mp4 file and selecting Copy Path option.
Paste this path into your variable in my vars.env file. It should work now :)

Getting Bad configuration option: \377\376h

I am setting my systems for codecommit. but getting following error
I followed the below link :
https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-windows.html
/c/Users/Prasanna/.ssh/config: line 1: Bad configuration option: \377\376h
/c/Users/Prasanna/.ssh/config: terminating, 1 bad configuration options
here is the config file
Host git-codecommit.*.amazonaws.com
User ********
IdentityFile ~/.ssh/codecommit_rsa
Am I missing anything to configure ?
You probably have some illegal characters in the config file. I had this problem while creating a config file on Windows. Unfortunately, simply opening the file in a Windows text editor may not show the illegal characters.
I was able to find this problem by running cat filename from a Bash prompt in Windows (git bash) and was able to fix it by running dos2unix filename in git bash. The same may work for you as well.
Just had the same issue. Open the file with Notepad++. On the bottom right it tells you the encoding the file is in. It has to be UTF-8 without BOM. You can fix that via selecting a new encoding at the top and saving the file.
This happened to me today, and I just recreated the config file and put my configs there, it works.

django:ModuleNotFoundError: No module named 'pure_pagination'

I used "pip install django-pure-pagination", and regiter "pure_pagination" into seetings.py.
By use "help('pure_pagination')", I can find the module.
But when I debug it on the PycharmIDE. It showes "ModuleNotFoundError: No module named 'pure_pagination' ".
enter image description here
enter image description here
I think you need to configure your pycharm to for your virtual environment.
Copy pasted from Pycharm documentation:
In the Project Interpreter page, click and select Add.
In the left-hand pane of the Add Python Interpreter dialog box, select Virtualenv Environment. The following actions depend on whether
the virtual environment existed before.
If Existing environment is selected:
Specify the required interpreter: use the drop-down list, or click Select an interpreter and find one in your file system.
Select the check-box Make available to all projects, if needed.
Click OK to complete the task.

Access denied when updating config file in ProgramData directory. How do I fix this?

I can't seem to update my configuration file in c:\ProgramData\appname\config.ini. I keep getting an access denied error. Seems the ini code fails to be able to delete the existing .ini file when trying to update it with the new file. Funny thing is that I have other programs I've written that share the same code but don't have this problem. This is troubling.
Comparing my working program with this non working program, I noticed that when I click on the security tab for the ini file, I see that my user name [Scott] is not listed under "Group or Usernames" like in the working program's ini file. Also, the non working one has a shield next to Delete and Rename (when right click on filename) while the working one does not have this. How can I set the permissions? The setup file for both projects is identical and when I create the folder and copy the program file in Isso Setup, no permissions are set (read only flag is not set, hidden is not set, and System is not set).
Why am I getting this and how come my other program install and works fine? Installer runs as administrator and does the access permission prompting. What do I need to do?
This is because your program was not run as an administrator. You have to either run your program as an administrator or move your .ini file and any other files you wish to update during the duration of the program to a location like C:\Users\\AppData\Local\. Note that for the latter option you will have to update your program likewise.
To run your program as an administrator right-click on ur program (or shortcut) and click Run as Administrator.

Why can't I launch notepad++ from the command line anymore?

I'm teaching myself some Django tonight using the local dev package at instantdjango.com
I made it through half the tutorial, building a basic map with points on it, then closed out of the console for a bit. I just fired it back up and now when I try to use notepad++ to edit files, console tells me it doesn't recognize the command. What happened?
When I as working through the first half, I was able to type: "notepad++ filename.ext" and I'd get a text editor that would pop up.
Now when I type that, it doesn't recognize the command.
How do I get back the ability to use the text editor and how did I lose it?
In a windows terminal, you can launch notepad++ with the following:
start notepad++ <filename>
Note that the filename is optional.
Most likely the directory in which the Notepad++ executable resides is not in your system's PATH. For information about fixing this please see How to set the path in Windows 2000 / Windows XP.
If you are using gitbash or cygwin, you can create an alias
alias np='start notepad++'
And use
np myfile.txt
This is what I have done, in this way you dont have to type notepad++
Create np.bat file with this set of commands
#echo off
start "" "C:\Program Files (x86)\Notepad++\notepad++.exe" %*
place np.bat file in c:\Windows
open the command prompt and type np or np myfile.txt and enter.
One way is to make a change to this registry key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Notepad++.exe]
You can download a zipped .reg file from Donn Felker that lets you open a file with just an n shortcut.
I edited the .reg before running it and to make sure the path to Notepad++ is correct (e.g. C:\Program Files (x86)) and I also changed the shortcut to n instead of n.
Then double click to add to your registry.