I've installed and configured the Django app LBForum on Windows 8.1 and cannot get it to run. My ultimate goal is to get it to run alongside Mezzanine, but I can't even get it to run on its own.
Here's what I've done:
(As a precondition to the following steps, I have the following C/C++ compiler installed to support pip. http://www.microsoft.com/en-us/download/details.aspx?id=44266. The batch file vcvarsall.bat is on the path environment variable.)
Perform a fresh install of python 2.78. I used the ActiveState distribution 64 bit.
I then uninstall and reinstall virtualenv because of a bug as per these instructions (https://askubuntu.com/questions/400343/trying-to-create-a-python-virtual-environment-but-getting-oserror)
Next I activate the new environment env\Scripts\activate.bat
Next install lbform with pip install lbforum which fails because of "PIL" so I install that by itself. pip install PIL --allow-unverified PIL --allow-all-external per Installing PIL with pip.
Then install lbform with pip install lbforum which seems to work fine as it reports success
Next I use the standard django commands for creating a site and adding a project.
I update the urls.py and the settings file for the site per the instructions found here: https://github.com/vicalloy/LBForum. Leaving off step 7.
When I run the app I see the following errors:
RuntimeError: South does not support Django 1.7 or higher. Please use native Django migrations.
I get different errors when running along Mezzanine but I'll create a different question for that once I know how to get this to run stand along in its own virtualenv.
Update: I've made some progress on this by removing south from INSTALLED_APPS. After doing so I was able to run .\manage.py migrate successfully. However I know see other errors:
File "c:\Users\cmedcoff\envlbf\lib\site-packages\attachments\urls.py" in <module>
1. from django.conf.urls.defaults import patterns, url
Exception Type: ImportError at /
Exception Value: No module named defaults
Apparently the package django-lb-attachments (0.8.3) is looking for the package/module "django.conf.urls.defaults" which does not exists in version Django (1.7.7)? So I guess lbforum docs suggest that Django 1.3+ is supported but this is not the case for 1.7.7 without import edits?
The problem when you install lbforum which in pypi last update was on 2011.
The project has set the Django dependency as Django>=1.3, so it will install Django 1.7 :S.
Similar thing happends with PIL, you should install Pillow instead of PIL.
Also this project seems to be incompatible with Django 1.5 and has some out dated deps
I think you need to follow this steps (I tried them on linux)
pip install Django==1.3
However I will recommend to use the latest version of Django.
you can try to install dev version with this command (you will need git), but it seems to be not compatible with Django 1.5
pip install git+https://github.com/vicalloy/LBForum
Tehere is a fork which it seems to be compatible with Django 1.5+, but I didn't have time to check it.
pip install git+https://github.com/bjinwright/LBForum
check it here
For installing Pillow instead of PIL
pip uninstall PIL
pip install Pillow
Related
Hello I've been trying to add an ImageField for one of my models in my Django app.
When I ran the following code:
python3 manage.py makemigrations
A statement came out, saying I needed to install Pillow, which I did ('Successfully installed Pillow-8.2.0').
However, when I tried to run makemigrations again, the following error occurred:
(fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
I am aware that there are several threads out there that have discussed similar issues (like python/django - "Cannot use ImageField because Pillow is not installed") and I have tried doing whatever was recommended (reinstalling 64-bit Python, upgrading pip, making sure I don't have PIL, attempting to install an older Pillow version) but none worked.
Particularly, attempting to install an older Pillow version caused errors with the following message:
Pillow 7.1.0 does not support Python 3.9 and does not provide prebuilt Windows binaries.
I am using Windows 10, Python 3.9, Django 3.2.0 and Pillow 8.2.0 . Would really appreciate it if anyone can help me with this, thank you!
first of all; there are some questions to be clear in order to provide input for it. Questions like;
1- Do you activated your virtualenv,
2- How did you check if Pillow installed correctly?
.......
normally, activate virtualenv and then, run the command
pip freeze
this will list down all of installed packages.
Just type
pip3 install pillow
Hope this works
I'm trying to use Django and displaying images from a Sql db, following this LinkedIn Learning tutorial.
In the process of running manage.py to run my django development server, I face an issue where I have to have pillow installed.
This process has so far proven tedious and here are the things I've tried:
Ran the "simple" python -m pip Pillow, python -m pip Pillow --upgrade in the PyCharm terminal, then get:
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
(Pycharm Ultimate, which I have): Running the WSL environment as provided in the release notes. This should to work as I have the required pre-reqs installed in WSL. However, my computer runs the dreaded "skeletons" process for quite a long time, and I don't see it ending anytime soon.
Attempting to install from the PyCharm GUI also fails in the same way as 1.
Attempting to install the following binaries from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow which is referenced in some other answers for this topic gives me this error when installing via pip install <wheel name here>:
Pillow-7.0.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.
**pip3 doesn't work either. Mentioning although in my PyCharm virtualenv they both point to the same python interpreter. At first glance...
My main ask is - has anyone been able to install pillow 7.0.0 on Windows 10, for a PyCharm virtualenv? And, if so, how have you done it? So I can get back to learning! Thank you in advance!
EDIT: Updated steps taken in (1). Sorry about that
I have been trying to debug this for quite a while now (and read lots of related Q/A on StackOverflow) but unable to figure this out.
Trying to setup Django on my Mac OS X 10.11.6. I followed the detailed tutorial. This is what I did:
1) Installed Python 3.5.2 (by directly downloading the package from the Python web site and running it).
2) Installed PostGres 9.5 using the fink package (fink install postgresql95)
3) Installed psycopg2 using the fink package (fink install psycopg2-py35).
4) Updated pip.
5) Setup a virtual environment and activated it.
6) After activating the environment, installed Django (via pip).
Next, when I tried to setup a sample app in the environment and ran python manage.py migrate, it gave me the error : Error loading psycopg2 module: No module named 'psycopg2'
After reading a lot of posts on StackOverflow, it seemed that I have to install psycopg2 again within the virtualenv (and for some reason, I cant use Fink again?). So as suggested on some posts, I tried to install it using:
pip install psycopg2
Got this error:Error: pg_config executable not found.
I am sure my Fink install of Postgres 9.5 was successful earlier, so I tried to search for pg_config from root dir:
sudo find . -name "pg_config"
But it returned nothing!
My question is, is it possible that fink package did not come with pg_config? If it didnt, is my only option now to uninstall postgres and install it with another package? (FYI: I was able to start PostGres and create a user and a database on it already)
Thanks in advance,
Anupam
Update: After waiting a while to get answers from SO, I gave up and just uninstalled the postgres fink package. Then installed the postgres.app instead, on my mac. Working fine for me. The command python manage.py migrate worked fine for me this time and the psycopg2 installation also went fine (with pip). I wonder why the psycopg2 installation page (http://initd.org/psycopg/docs/install.html#installation) only mentions Fink and MacPorts as the installation options especially when the Fink packages dont seem to be very reliable. I had posted a message on the Fink users group also about improving the installation documentation in another context but didnt get a response : (
I installed anaconda a little while ago. Later I installed django. Django was the first program I could install successfully and run without error.
I just tried to install mysqldb with the following:
sudo apt-get install python-mysqldb
and it gave following message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-mysqldb is already the newest version.
The following packages were automatically installed and are no longer required:
linux-headers-3.5.0-17 linux-headers-3.5.0-17-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
If I run a django app configure to have a mysql back-end I get
ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
I think this has something to do with having anaconda installed. I'm running on ubuntu OS.
Does anyone know how I can get mysqldb module to get recognized by django?
It looks like all my anaconda modules are in:
/home/aiden/anaconda/lib/python2.7
I think my django lives in:
/home/aiden/django/
and i searched for mysqldb and found a file under anaconda:
/home/aiden/anaconda/lib/python2.7/site-packages/sqlalchemy/something.../drizzle/mysqldb.py
I don't know how to check where I installed things to, but I think that mysqldb isn't getting installed b/c it's already somewhere in anaconda
apt-get is going to install things into the system Python. To install things into Anaconda, you need to use the conda package manager, assuming the package is build for conda already, or else build from source. You can also try to find the package on binstar.org if there isn't one in conda already.
I just ran a "conda install bottle" but it didn't have the package available, but it automatically installed bottle using pip. This works fine. Anaconda is great.
I want to install some specific version of a package (in this case Django) inside the virtual environment. I can't figure it out.
I'm on Windows XP, and I created the virtual environment successfully, and I'm able to run it, but how am I supposed to install the Django version I want into it? I mean, I know to use the newly-created easy_install script, but how do I make it install Django 1.0.7? If I do easy_install django, it will install the latest version. I tried putting the version number 1.0.7 into this command in various ways, but nothing worked.
How do I do this?
There was never a Django 1.0.7. The 1.0 series only went up to 1.0.4. You can see all the releases in the tags section of the Django code repository.
However to answer your question, don't use easy_install, use pip. (If it's not already installed, do easy_install pip, then never touch easy_install again). Now you can do:
pip install Django==1.0.4
+1 on the previous poster's reply: use pip if you can. But, in a pinch, the easiest way is to install an older version would be to download the tarball from the downloads page or, if you have subversion installed, do an svn export of the release you want (they are all tagged here).
Once you have the version of Django you want, just run the following command inside the django directory:
python setup.py install
This will install that version of Django in your virtualenv.
+1 for already mentioned solutions.
I just wanna add another solution.
To install a specific version of Django (say 1.10.x),
Clone the Django repo from Github.
git clone https://github.com/django/django.git
Go into the directory and checkout to the specific branch.
cd django
git checkout origin/stable/1.10.x
Run install command.
python setup.py install
pip install "django>=2.2,<3"
To install djnago 2.2
pip install django==(the desired version ex: 1.8.4)
This will allow you to install the desired version, and I tried on OS:Windows10 and it perfectly worked.