No module named changelist_ordering - python

I am trying to import changelist_ordering. So I have tried to install the package django-changelist-ordering. But I am getting the error:
No matching distribution found for changelist-ordering
Can anyone help me to solve this issues.

First of all install changelist-ordering by performing the following steps:
git clone https://github.com/SergeyKubrak/django-changelist-ordering
cd django-changelist-ordering
sudo python setup.py build
sudo python setup.py install
or you can install the package by running just one command (#jonrsharpe):
pip install git+https://github.com/SergeyKubrak/django-changelist-ordering
Now in your projects settings, include the app changelist_ordering in your INSTALLED_APPS
and then wherever you wanna use ChangeListOrdering import as
from changelist_ordering.admin import ChangeListOrdering
If this also does not work for you, check whether the module is installed in your virtual environment or not with
pip list | grep changelist-ordering
This should get you a result if changelist-ordering is present in your virtual environment else your Django application is trying to access the module which is not present in your virtual environment.

Related

How to correct wrong pip path in venv?

I have a Flask app that with and using venv for my virtual environment. For some reason, which pip has suddenly stopped installing packages in venv/lib/python3.9/site-packages, but to a completely different repository on my system. How do I redirect pip to install packages to the correct path in venv?
instead of using pip as a stand alone command in terminal, i suggest you to use python -m pip instead, here python will be assoicated with the project (in case of Virtual environment) or whole system level (in case docker single app ). This will keep track and tell the system to run all package/module related to python interpreter assoicated with the project only
You can use the -t flag provided by the pip install command.
pip install <package_name> -t <full_location_path>

Is there a way to install Flask globally

I am new to Python. Today I installed flask in C:Users\myName\FolderA using below commands and it worked fine. But when i try to create a structure C:Users\myName\FolderA\FolderB and create app.py in it, my VSCode says "ModuleNotFoundError: No module named 'flask'". Does this mean i need to install flask in Folder B too? Is there a way to install flask globally and make all folders under 'FolderA' access the libs?
Commands used to install Flask
C:Users\myName\FolderA\py -m venv env
C:Users\myName\FolderA\env\Scripts\activate
(env)c:Users\myName\FolderA\pip install flask
You are using a virtualenv. Everything installed inside a virtualenv resides inside that virtualenv (which is nice in fact: all your dependencies for that project only!).
If you want to install packages globally, run
pip install flask
without having run the activate script first (that activates your virtualenv).
PIP should install packages globally. You shouldn't have to reinstall flask everytime. Seems like something is wrong with your PIP. How did you install Python?
You could try updating PIP, which could fix it. Try running
python -m pip install –upgrade pip
in cmd.
Edit: This could also be an issue with Visual Studio Code. Try running the python code through CMD.

How do I store a Python package on Gitlab and install it in a Conda environment?

I followed the steps in this tutorial to store and install my package using Git and pip:
I created a git repo of the project directory and used pip to install it from that repo. When I try to import my package, I got this error
ModuleNotFoundError: No module named 'statstemplate'.
I ran conda list and my package is listed
Name Version Build Channel
... other packages ...
statstemplate 0.1 <pip>
I tried to remove that package and try again by running conda remove -n myenv statstemplate and got an error
PackagesNotFoundError: The following packages are missing from the target environment
- measurements
I then tried installing the package in the tutorial just to prove to myself that it works and I got the same problem. I get the same error messages when I try to import the module in the tutorial and remove it from my conda environment.
Can somebody please explain to me what I did wrong?
(I do not just want to run python setup.py install. I'd like to store it in GitLab).

Issues in installing packages on webfraction

I am trying to setup my project on web-fraction . My project using some external packages and when I installed them using pip they got installed in root lib dir i.e., $HOME/bin but my project is using python inside my app i.e., $HOME/webapp/app/bin . Now I simply wants that I can able to install packages inside my app i.e., inside webapp . I have used one command for this but that doesn't work :
pip-2.7 install --install-option="--install-script=$PWD/bin" --install-option="--install-lib=$PWD/lib/python2.7" package
I have read webfraction docs but I didn't get it right . So please tell me the steps how I can install packages inside webapp .
For instance, let's say you want to install django-haystack 2.0.0 on webfaction, using pip. You could do the following ($PWD does not work I think) :
pip-2.7 install django-haystack==2.0.0 --install-option="--install-scripts=/home/your_account/webapps/your_django_app/bin" --install-option="--install-lib=/home/your_account/webapps/your_django_app/lib/python2.7"

django virtualenv mimeparse import error

I can't for the life of me figure out what I'm doing wrong, here's what's going on:
I'm running google appengine with django on my local dev
this is happening from within a virtualenv running python2.5
I have installed the mimeparse package using pip install -E for that virtualenv
I have verified this by checking the site packages in my 'something-env/lib/python2.5/site-packages' for the mimeparse.py
running the python shell lets me import mimeparse
running python manage.py shell also lets me import mimeparse
running python manage.py runserver will fail on import mimeparse, but in the pretty django error page I can see that the python path contains the something-env/lib/python2.5/site-packages folder
what can I be doing wrong?
NOTE: copying the mimeparse.py into the project root will work, but that is not exactly pretty.
If you get stuck running Ubuntu, with the following import error: no module named mimeparse, just install it, by adding the following line on your terminal in the appropriate directory :
pip install mimeparse
There is a debian package:
sudo apt-get install python-mimeparse
But, I didn't need to install the debian package. Just the first command and works for me.
Don't forget to activate your env.
source $PYTHON_HOME/activate
My $PYTHON_HOME points to my virtualenv python.

Categories