Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'force_text' from 'django.utils.encoding' #228

Open
5 tasks
Qbes179s opened this issue Jun 21, 2022 · 4 comments
Open
5 tasks

Comments

@Qbes179s
Copy link

Checklist

  • I have verified that I am using a GIS-enabled database, such as PostGIS or Spatialite.
  • I have verified that that issue exists against the master branch of django-cities.
  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have reduced the issue to the simplest possible case.
  • I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)

Steps to reproduce

Expected behavior

Actual behavior

@franhace
Copy link

franhace commented Aug 4, 2022

Hey @Qbes179s which django version are you using?
The pypi version of this package is not updated, hence doesn't support django versions >= 4, where
force_text was removed.
In that case you should pip clone the package.

@ddahan
Copy link

ddahan commented Aug 17, 2022

Thanks this helped me. The documentation is a little misleading, because the remote package name is the same than the extracted folder. So it's easy to pip install the remote package instead of the extracted one ^^

However, may I ask why the package is not updated? It seems the project is not maintained by the initial author. However, as the Github repo seems to be up to date, why not the pypi package?

@arthanson
Copy link
Collaborator

Just a matter of time, will try to look into getting one released soon, but there is some tooling stuff I have to check on.

@ddahan
Copy link

ddahan commented Aug 17, 2022

@arthanson Thanks for the answer.

My bad, I was struggling with the installation doc, until I realised these are not 3 steps to follow, but 3 different ways to install django-cities.

I feel a little dumb, but I suggest clarifying this step anyway, with:

  1. Adding a There are 3 different ways to install the project: paragraph
  2. Dissuading people to use the pip install solution as it's currently not maintained.

Maybe the best way to install the project at the time is to use pip (or another package manager like Poetry), but pointing to the git repository. Something like:

pip install git+https://github.com/coderholic/django-cities.git should work.

Doing this:

  • No way to install an old package from PyPi and have weird errors, by mistake
  • No need to wget stuff manually (which would not work with hosting services like Heroku for example)

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants