pycharm cannot find module with installed by pip - python-2.7

enter image description here
I have tried many ways, but they still can not figure out my problem. Hope for your help.

I am not sure this will help or not, if possible then create new virtualenv and install required package again. And change old virtualenv with new one.
Hope this will help.

Related

Django installation dependency errors after rolling back to Python 3.7.6

I'm working my way through the tutorials in William S. Vincent's Django for Beginners. Everything worked fine until Chapter 4 (the Message Board app), when like a nOOb I ran into the known bug that causes Django's web server to crash when attempting to serve /admin/ using Python 3.7.* in pipenv. So, I upgraded Python to 3.8.2, and it still didn't work. So I foolishly deleted 3.8.2 and rolled back to 3.7.6, and now I can't install Django at all with pipenv due to a variety of pipenv.exceptions.ResolutionFailure statements.
I've reinstalled Python 3.7.6 AND 3.8.2, pip3, pipenv and Django (through Anaconda as well as outside of it), but I'm still getting the same litany of errors that won't let Django be installed in my virtual environment. Using pipenv lock --pre --clear doesn't fix it.
The telling line is "ERROR: No matching distribution found for django-3-0"
Does anyone have any idea how to resolve this or what packages I need to uninstall/reinstall?
Thanks much! :)
Manually delete the whole pipenv cache directory,
~/.cache/pipenv - (Linux)
%LOCALAPPDATA%\pipenv\pipenv\Cache - (Windows)
Also delete the previous virtualenvs which were created within the .virtualenvs folder. (or the entire folder)
Default location: C:\Users\{username}\.virtualenvs
Also delete Pipfile.lock file and then recreate your virtual environment:
pipenv shell
Well, good news! On a hunch, and to rule-out any weirdness, I tried recreating a clean Django install by using virtualenv, since pipenv is giving me problems. It worked! I must have borked something with pipenv when I removed/re-added/re-removed Python 8.x. Thanks for your inspiration for this workaround, #Magicoder!

Prestashop installation error

I am facing a problem when I install prestashop in wamp
When until module installation it show
Error-500
I have search for many ways but all is just stopped at the install demonstrate data no one
Facing problem in module install
Can I know how to fix it?
Install XAMP & then install prestashop in that.

After editing a locally installed package in Heroku it resets

I've noticed that after the packages required written in "requirements.txt" were installed they are not installed anymore every time I push changes into the Heroku application I'm working, so I was assuming that those files were not modified anymore.
I then changed a file in /app/.heroku/python/lib/python2.7/site-packages/target_library/target_file but when I do git push the file goes back to its original state, although the library is not being installed again.
Is there a way to avoid libraries to be reseted or any workaround?
Based on the last answer.
or fork the library on GitHub and install the forked version.
Here are the few steps I've tested and it worked for me:
1- Fork the package repo on GitHub.
2- Edit it and change whatever you need.
3- Now remove the original package name from your requirments.txt and replace it with git+https://github.com/you-github-username/forked-edited-package.git
Now it should simply install the edited package to your Heroku dyno when you deploy the project
No this can't possibly work. Heroku will always install the packages directly from PyPI and won't know anything about your modifications. I don't know why you say they aren't installed again - on the contrary, they are.
Are you sure you really need to do this? It's a fairly unusual thing to do. If you are sure you do, then the only thing to do is to either for the files into your own project, or fork the library on GitHub and install the forked version.

Installing Python 2.7 for all users on SLES 11

I installed Python 2.7 on SLES 11 box that previously was running Python 2.6. To do so I used a script described in this post and run it as a root user. Everything went well but when it was done I discovered few issues:
No symbolic links were created and no path updated so I had to manually update the path to link to the new installation bin directory /opt/python2.7/bin
Everything runs good until I switch from root to the normal user at which point Python shell runs but some modules I installed such as PyYAML are missing. Again, these are OK when I run Python as root
As a regular user I'm not able to run pip, easy_install and wheel. For pip I get ImportError: No module named pkg_resources
P.S. Following #user suggestion I tried adding the following path taken from sys.path of the root user to .bashrc which did not fix the problem
export PYTHONPATH=$PYTHONPATH:/opt/python2.7/lib/python27.zip:/opt/python2.7/lib/python2.7:/opt/python2.7/lib/python2.7/plat-linux2:/opt/python2.7/lib/python2.7/lib-tk:/opt/python2.7/lib/python2.7/lib-old:/opt/python2.7/lib/python2.7/lib-dynload:/opt/python2.7/lib/python2.7/site-packages:/opt/python2.7/lib/python2.7/site-packages/PyYAML-3.11-py2.7-linux-x86_64.egg:/opt/python2.7/lib/python2.7/site-packages/pexpect-4.2.0-py2.7.egg:/opt/python2.7/lib/python2.7/site-packages/ptyprocess-0.5.1-py2.7.egg
Credible / official sources: no reply from official forum. Apart from the SO-link you mentioned, there is also https://unix.stackexchange.com/questions/7644/how-to-do-a-binary-install-of-python-2-7-on-suse-linux-enterprise-server-11, which sketches the way to do it described in Installing Python 2.7 on SLES 11 (SO is not official, is it? ;-)
Concerning your problem: both 2. and 3. might be caused by elements lacking in sys.path.
To test this, type
import sys; sys.path
both in user and root python and check for differences. These need to be merged. Try using PYTHONPATH first to test this, but be aware that there are different methods how to adjust sys.path.
If you just need to fix this for normal (non-daemon) users, adjusting the system-wide bash profile would be an easy solution.
(Any questions/feedback is welcome... :-)

How to make update in Django webservice made in python on windows

I have installed Python 27 successfully.
And with respect to project requirement i have also installed following packages.
Django==1.4.3
MySQL-python==1.2.4
PIL==1.1.7
South==0.7.6
argparse==1.2.1
distribute==0.6.28
django-appconf==0.6
django-imagekit==2.0.2
pytz==2012j
six==1.2.0
wsgiref==0.1.2
Now the problem is, i dont know how to make this run, or visible in python.
Can anybody please help me, to get out from this.
I have to change few webservices and also want to add some functionality.
This webservices are attached with wordpress website.
So, please help me to configure whole this project on local (Windows PC).
Thanks in advance
Go for the Touch Command of Django for this issue,
I think it will make helpful to you.
Thanks!
i have solve this, find below instruction for users who have same queries:
Restarting the Spawned Server
If you change any Python code on your site, you’ll need to tell FastCGI the code has changed. But there’s no need to restart Apache in this case. Rather, just reupload mysite.fcgi – or edit the file – so that the timestamp on the file changes. When Apache sees the file has been updated, it will restart your Django application for you.
If you have access to a command shell on a Unix system, you can accomplish this easily by using the touch command:
touch mysite.fcgi
For more information:
http://www.djangobook.com/en/2.0/chapter12.html
Thanks