django:ModuleNotFoundError: No module named 'pure_pagination' - django

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.

Related

How to use Chrome as build in Sublime Text

I'm trying to set up Chrome as a build system in Sublime Text on MacOs.
Tried using the New build menu option and plugged in:
{
"/Applications/Google Chrome.app": "Chrome"
}
It appears in list after I restart as build option but doesn't work. Any ideas?
For reference, the build system documentation has lots of examples if you want to add more functionality. However, for now, we'll just make a simple build system with one command - open the current file in Chrome.
Each build system needs to have a "cmd" key - the command you want to run - and optionally a "selector" key - a rule for selecting which types of files you want to run. For now, we'll just assume you only want to run HTML files. Select Tools → Build System → New Build System… and replace the contens with this:
{
"cmd": ["/Applications/Google Chrome.app", "$file"],
"selector": "text.html"
}
Next, hit Save and save the file in the suggested folder with a name like Chrome.sublime-build. You don't need to restart for it to be visible in the Build System menu.
Now, when you want to view an HTML file in Chrome, you'll first select Tools → Build System → Chrome, then hit ⌘B to actually run the build. Chrome will stay selected as the current build system, so if you want to build again all you have to do is hit ⌘B.
If you do any work on Windows or Linux, the build command shortcut is CtrlB.

jupyter notebook default folder won't change

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)

Add CMAKE variables to project in KDevelop

How can i add CMake variables (e.g. CMAKE_PREFIX_PATH, CMAKE_CXX_COMPILER) to a project in KDevelop5?
Setting the environment variables in Configuration->Environment tab and Project->Configuration->Environment can only set the environment variables but not the cmake variables.
Thank you for your replies.
When you go to Project -> Open Configuration, you'll see a frame named "Configure CMake settings" In that window, you will see a dropdown that contains the path of your build directory.
Just at the right of that dropdown, you'll see a + button. Click on it. You will see that you can specify Extra Arguments. In this field you can add command line argument to be run with cmake.
In your case, it will be something like this:
-DCMAKE_PREFIX_PATH=<your path> -DCMAKE_CXX_COMPILER=<your compiler>
In addition, if you want to quickly change a variable in a temporary manner, you click on the button "show advanced" and check the case labeled "Show Advanced Value". Then, in the table, you'll see all cmake variables displayed. You can edit them. Be careful with that because kdevelop tends to be instable when you manually change cmake variables without reloading the project.
Note that if you want to keep the same directory as before, you can remove your build directory and then re-add it with the arguments.
I don't know other way to change the extra argument field for the moment.

How to launch application after silent installation in advanced installer

First, I import resources.
Then I tick "Limit to basic user interface" in Install Parameters -> Installation Options.
Then I go to Custom Actions and create "Launch File" after "Finish Execution",
File to launch = "APPDIR\Test.exe", conditions = "NOT Installed", others default, as written here http://www.advancedinstaller.com/user-guide/qa-launch-application.html
That's all I do
But while installing it messages "There is a problem... A program run as part of the setup did not finish... ";
I suspect that the path you enter in the "File to launch" field is not correct. To make sure that the correct path to the file is used you can simple right-click into that field, select "File...", then choose the file that you want to launch from the dialog that appears (the path will be formatted like this: [#Test.exe]).
In order to use a property you can write it like this: [APPDIR]Test.exe.
If the problem persists create and attach here a verbose log of the installation.

kdevelop no valid executable specified

I've just installed kdevelop 4.1 , then created a normal hello world , build is ok but when i press execute it gives me (no valid executable specified) any idea ?
Meh, the launch configuration - our biggest usability problem...
Go to Run -> Configure Launches
select your project to the left
hit the "+" button
to the right, select your project target
optionally add a build dependency (again, select e.g. your target).
that should be it.
/me really wants to rewrite this dialog...
After following the steps provided by milianw. In case it doesn't work, follow this steps:
Go to Run >> Current Launch Configuration
choose the current file name you are trying to compile.