I keep trying to set up a project with Eclipse Neon Release Candidate 3(4.6.ORC3) and PyDev 5.1.1 and keep having the same problem. Going to Project > Properties > PyDev-Django screen, I keep getting the same error Settings Module could not be found. I have tried everything to try to fix this error, including manually filling in the DJANGO_SETTINGS_MODULE manually. Nothing works. The problem really exist because manage.py tests and runserver return the same error. The settings.py file exists and is in the correct place in the project directory. I am dead in the water untill I get this fixed.
Note: I upgraded the system to Neon 4.6 and PyDev 5.1.2 . I still have the same problem
Using Debian Linux Stretch with KDE Desktop.
Please help.
Gary R.
Before adding the project to the python path
Adding the python path to the project:
now pythonpath is added to the project
After adding python path to the project settings module is found
I am using: django 1.10, pydev 5.2
Make sure the PyDEV PYTHONPATH settings includes the directory where manage.py lives.
Related
I use anaconda's interpreter as pycharm interpreter. I wonder if all the module included in the "conda list" should appears in pycharm. In my situation, the anwser is NO, I need to install the modules which are already included in the "conda list"
Is it normal?
In the Settings -> Project Interpreter you can switch to the Conda Package Manager mode.
Also in the Project Interpreter drop-down menu above, make sure you are using the correct Conda Environment.
I'm following CS231n and met a problem when doing assignment2: ConvolutionalNetworks: global name 'col2im_6d_cython' is not defined.
I think the problem was due to a failure in importing functions from im2col_cython.pyx, which used cython.
I've installed Xcode 7.3.1, as shown below, but the problem was still not solved.
I'm running the ipynb files in Jupyter from Anaconda. There is a related discussion on reddit, but unfortunately the solution here was for Windows, not Mac OS X.
Thank you for your time.
I wanted to add my input as a comment but didn't have enough reputation points to do so.
The issue was resolved for me when I closed the jupyter notebook and opened it again. I compiled the cython extension after I got the import error and probably have to relaunch it when the .so file is available.
I solved this with 2 easy steps:
In the terminal, run python setup.py build_ext --inplace in the cs231n directory.
Then reopen the notebook (if necessary, shutdown the notebook, the open it again);
Ps.: I tried this through the notebook using !python ./cs231n/setup.py build_ext --inplace as well. It does not work! You have to that outside the notebook, using the terminal.
I had this problem recently. I googled it a lot and also tried un-/-reinstall Anaconda. However it does work further. So I used "which python" to figure out which python's been using. And it turns out that the python included in Anakonda directory is used as default. I then tried the python2.7 in my macOS, which is located in /usr/bin/python2.7. Although I got a couple of warnings, but now it works likes charm. Perhaps it's kind of version problem. Solved in macOS Sierra 10.12.4.
I compared the two compiling results, as it shows that the include files are totally different. The one in Anaconda includes all header files in python3.6. Instead we need here corresponding header files in python2.7(I suppose). As the red circles point out.
enter image description here
Supported by python 3 onwards. Go to setup_googlecloud.sh and change the line
virtualenv .env
to
virtualenv -p python3 .env and run the setup again as explained in assignment1 setup..
Works well after that..
It occurred to me as well.
My problem:
I saw that the extention file that is created is named "im2col_cython.cp37-win_amd64.pyd" and the import is looking for im2col_cython alone, so I changed the file name to "im2col_cython.pyd" and ran the setup script again.
Now when I ran the code in the notebook it found the module but it said that the dll was compiled with a different python version. I use Anaconda envs and it turns out that since I ran the setup script from the cmd, it used a different python version than the one of the environment. I deleted the created files from the cs231n directory (im2col_cython.cp37-win_amd64.pyd and im2col_cython.c) and ran the setup script again, this time from the env Anaconda Prompt and it worked.
Solution:
remove already created files (the .c and .pyd files)
run the setup
script from the environment prompt (not plain cmd)
change the .pyd
file name into im2col_cython.pyd
Enjoy!
I recently started working on a project using just vim as my text editor with a virtualenv setup. I installed a few API's on this virtualenv from GitHub. Eventually, the project got a little bigger than vim could handle so I had to move the project to an IDE.
I chose Aptana Studio 3. When I started up Aptana, I pointed the project directory to the virtualenv folder that I had created to house my project. I then pointed the interpreter at the Python executable in App/bin (created from virtualenv)/python2.7. When I started reworking the code to make sure I had everything mapped correctly, I was able to import the API's that I had installed just fine. CherryPy came through with no problems, but I've been having an issue with importing a module that I believe is part of the stdlib--urlparse. At first, I thought it was that my python interpreter was 2.7.1 rather than 2.7.5 (I found the documentation in the 2.7.5 section with no option to review 2.7.1), but my terminal is using 2.7.1 and is able to import the module without any errors (I'm using OSX, Mountain Lion). I am also able to import the module when I activate the virtualenv and run my python interpreter. But when I plug "from urlparse import parse_qsl" into Aptana, I'm getting an error: "Unresolved_import: parse_qsl".
Should I have pointed this at a different interpreter and, if so, will I need to reinstall the API modules I had been working with in the new interpreter?
Update: I finally ended up restarting the project. It turns out that not all of the standard Python tools are selected when you select the virtualenv interpreter. After I selected all of the python tools from the list (just after choosing the interpreter), I was able to get access to the entire standard library.
Do NOT just import the modules into your project. Many of the stdlib modules are interdependent and the import function will only import a module into your main project directory, not a libary!
mac ox 8.2, eclipse juno, python 2.7, django 1.4.1, pydev 2.7.1.2012100913
I'm relative new with python/django and I'm trying to get it to work with pydev in a virtualenvironment. I set up the virtualenvironment installed django and successfully created and started a django project. After that I decided that I want to use my favorite editor eclipse.
I created a new pydev/django project, configured and selected a new interpreter (from virtualenv) and used that, I also included the virtualenv/lib/python2.7/site-packages/django in the interpreter libraries. However after going the next dialog, I got an error message "Django not found"
I went over the documentation but I haven't found any solution yet.
I was also wondering whether the workenvironment (or the actual code) needs to live in a subdirectory of the virtualenv directory) And whether the virtualenv must be activated (I suppose so), tried all these options but no luck yet.
As far as I'm aware you don't need the django installation (i.e., virtualenv/lib/python2.7/site-packages/django) in your interpreter libraries. Having the site-packages in there (i.e., virtualenv/lib/python2.7/site-packages) should suffice for your interpreter to find any django.* package.
putting this in your interpreter libraries:
virtualenv/lib/python2.7/site-packages/django
wiil not work, because there is no virtualenv/lib/python2.7/site-packages/django/django (yes, twice), this translates to the following:
export PYTHONPATH=<...virtualenv>/lib/python2.7/site-packages/django:$PYTHONPATH
python -c 'import django'
which fails with ImportError message. you need to give the parent directory.
virtualenv/lib/python2.7/site-packages
which translates to the following:
export PYTHONPATH=<...virtualenv>/lib/python2.7/site-packages:$PYTHONPATH
python -c 'import django'
.
I have installed and old version by mistake of django-registration and it seems quite complicated to fix it to the new one. So since i am just starting a project anew, how can I uninstall completely the module django-registration?
Remove the folder /usr/local/pythonX.Y/site-packages/django-registration where X.Y is your python version, which you can find by running python --version
If pip is installed then simply fire following command, that's it.
pip uninstall django-registration
Also you can confirm it by going to /lib directory at root or at virtual environment level.
e.g.
/lib/python2.7/site-packages/
If you cant see directory named registration means django-registration has been removed.