I'm using django and I'm trying to set up django-roa but when i'm trying to start my webserver I have this error cannot import name LOOKUP_SEP
If I remove django_roa from my INSTALLEDS_APP it's okay but I want django-roa working and I don't know how resolve this problem.
And I don't know what kind of detail I can tell to find a solution.
Thanks
This question is the top Google search result for "cannot import name LOOKUP_SEP", therefore although it doesn't necessarily solve any other compatibility issues between django-roa and Django 1.5 I want to point out...
You can solve this (specific) error by replacing:
from django.db.models.sql.constants import LOOKUP_SEP
with:
from django.db.models.constants import LOOKUP_SEP
django_roa is not yet compatible with django 1.5. I'm afraid it only works with django 1.3.
I downgraded from 1.5.2 to 1.4.0 and my app started working again. Via pip:
pip install django==1.4
Hope that helps.
Related
My project was created with Django 2.2 and I would like to upgrade it to use 3. My problem is the same as django error cannot import name 'RemovedInDjango30Warning' . The accepted answer is to manually edit files in the Python packages which I don't think is a good practice(?). The other answers say to downgrade, so is there really no way to upgrade the project without creating it from scratch?
The file where that error is coming from has been removed in Django 3 (https://github.com/django/django/tree/3.0/django/contrib/admin/templatetags has no admin_static.py), so you might not have upgraded properly.
Try to delete your virtualenv and re-create it from scratch.
I'm working on azure from past few months, and everything was working fine, and now I'm having issues, I cant import automlconfig and automlrun from azureml.train.automl. I have tried all possible solutions, even azure jupyter-vm which by default must have all these libraries but no success yet. I cant find this issue on there forums, any help or advice would be great.
error text:- (cannot import name 'AutoMLConfig',cannot import name 'AutoMLrun')
Could you please try following steps to see if it helps or not?
Completely uninstalled conda and reinstalled
Built the azure_automl env using azure_automl.cmd
Got from azureml.train.automl import AutoMLConfig to work.
Please let me know if you still have problem.
Regards,
Yutong
I can tell many people have had issues with this but having tried all possible solutions i have made my own post which hopefully can help solve this issue specifically for me.
When i try running db.create_all() i get this error (attached in pic):
Error observed
I understand this is because mysqldb does not support python 3. But i have also tried importing the pymysql and this didnt work either (unless of course i did that step wrong? I basically added the lines:
import pymysql
and then
pymysql.install_as_MySQLdb()
into my app.py file.
I am still really new to all of this. Anybody who's had this could they explain in simple steps please?
There is a workaround to using MySQLdb package for python3. Assuming you have pip3 installed,
sudo pip3 install mysqlclient
should install the necessary packages, you can use
import MySQLdb
as usual afterwards. That's how I've installed it and have been using it since.
I am using elementary OS and I want to make my own notifications using python 3. I know that a simple way of doing that is by import subprocess. However, reading around the web I found out that it's not the most appropriate way of doing it. Instead I should use from gi.repository import Notify but I get this error
__main__:1: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded.
I have been trying to solve this and using the following code seems to work.
import gi
gi.require_version("Notify", "0.7")
from gi.repository import Notify
Can someone explain the why this error was produced in the first place and why this is the way to solve it (if it's the correct way)? Thank you in advance.
PS. I asked in the www.elementaryos.stackexchange.com but I didn't get any answer. Maybe they are not familiar with this.
You can try installing package pip install gi==0.0.7 or pip install pgi==0.0.7
OR
you can use pgi instead of gi.
It happens because of version mismatch issue. I have same problem and just tried on my system and it works.
I installed Pylons 0.9.7 using the go-pylons.py script.
I have a line of python:
from webhelpers.html.secure_form import secure_form
When I try to serve my application I get the error: no module secure_form.
I've tried writing import webhelpers.html.tags and other modules from webhelpers and those work. I'm wondering why I don't have secure_form and how I can obtain this module manually? I've tried re-running go-pylons.py and it didn't help.
Any ideas?
if your webhelpers version is 1.0b4 or above, secure_form is under webhelpers.pylonslib, ie.
from webhelpers.pylonslib import secure_form
I just ran into this as well.
In case the other posts aren't obvious to get the old version of webhelpers you can run:
easy_install webhelpers==0.6.4
ugh, so for some reason I have 1.0b4 of webhelpers installed and the path to secure_form changed... (http://groups.google.com/group/pylons-discuss/msg/695d73b831a4aee3) I guess my question now becomes: how do I install a previous version of webhelpers? I have easy_install
Actually looking at this, I got something similar and the proper tested line of import is:
from webhelpers.pylonslib.secure_form import secure_form