python manage.py oscar_populate_countries throws error -
See original GitHub issueHello,
while running the following command I get this error -
./manage.py oscar_populate_countries
or
python manage.py oscar_populate_countries -
This’ the log.
./manage.py oscar_populate_countries
/Users/akos/oscar/lib/python2.7/site-packages/django/utils/six.py:808: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
return meta(name, bases, d)
/Users/akos/oscar/lib/python2.7/site-packages/django/core/management/__init__.py:345: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
self.fetch_command(subcommand).run_from_argv(self.argv)
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/akos/oscar/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/Users/akos/oscar/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/akos/oscar/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/akos/oscar/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/Users/akos/oscar/lib/python2.7/site-packages/oscar/management/commands/oscar_populate_countries.py", line 58, in handle
for country in pycountry.countries]
File "/Users/akos/oscar/lib/python2.7/site-packages/pycountry/db.py", line 22, in __getattr__
raise AttributeError
AttributeError
I have been google to find the answer. And evening ended up creating a whole new project again. What Im I doing wrong?
Regards
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
python manage.py runserver throwing error - django
I am getting the error given below. I am not able to start server. Please guide me? C:\training\webserver\webserver>python manage.py runserver ...
Read more >8. Errors and Exceptions — Python 3.11.1 documentation
The most common pattern for handling Exception is to print or log the exception and then re-raise it (allowing a caller to handle...
Read more >Python Exceptions: An Introduction - Real Python
In this beginner tutorial you'll learn what exceptions are good for in Python. You'll see how to raise exceptions and how to handle...
Read more >How to Throw Exceptions in Python - Rollbar
Difference Between Python Syntax Errors and Python Exceptions ... File "test.py", line 13, in raise Exception("Date provided can't be in the ...
Read more >Django settings - Django documentation
The command python manage.py diffsettings displays differences between the ... will raise an ImportError exception the first time a setting is accessed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As pycountry made new changes, the command
oscar_populate_countries
won’t work.So for an alternate way for populating countries, please follow steps below.-create a new file say
populate_countries.py
with the following code:--move this file to
your_apps_folder/management/commands
. Make sure that you add__init__.py
tomanagement
andcommands
folder.Refer this for help.-after completing all the above steps, run command as
python manage.py populate_country
.This command will populate db with countriesSame for me on a 100% fresh installation.
These are my installed packages in the venv:
UPDATE:
I reinstalled pycountry with the version specified on the requirements.txt (on the github repos), which is 1.8, and then everything ran without any errors. So maybe the preferred installation method is to checkout the github repos first, and then pip install from requirements.txt?