./manage.py migrate creates permission denied how to resolve it ?
./manage.py migrate creates permission denied how to resolve it ?
If your manage.py
file does not have execute permission (which can happen if you upload it from Windows) then you can give it that permission by running the Bash command
chmod +x manage.py
This happened after I did that
Traceback (most recent call last): File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/check_build/__init.py", line 48, in <module> from ._check_build import check_build # noqa ImportError: libgomp-a34b3233.so.1.0.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "./manage.py", line 22, in <module> main() File "./manage.py", line 18, in main execute_from_command_line(sys.argv) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/init.py", line 446, in execute_from_command_line utility.execute() File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/init.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/base.py", line 414, in run_from_argv self.execute(args, cmd_options) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/base.py", line 460, in execute output = self.handle(args, options) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/base.py", line 98, in wrapped res = handle_func(*args, kwargs) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 91, in handle self.check(databases=[database]) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/base.py", line 487, in check all_issues = checks.run_checks( File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/checks/urls.py", line 14, in check_url_config return check_resolver(resolver) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/checks/urls.py", line 24, in check_resolver return check_method() File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/urls/resolvers.py", line 480, in check for pattern in self.url_patterns: File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/utils/functional.py", line 49, in get res = instance.dict[self.name] = self.func(instance) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/urls/resolvers.py", line 696, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/utils/functional.py", line 49, in get res = instance.dict[self.name] = self.func(instance) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/urls/resolvers.py", line 689, in urlconf_module return import_module(self.urlconf_name) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 848, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/Anuj4388/RealEstateApp/real_estate/urls.py", line 5, in <module> from listings.views import ( File "/home/Anuj4388/RealEstateApp/listings/views.py", line 16, in <module> reloadModel = joblib.load('./models/pipeline1.pkl') File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 587, in load obj = _unpickle(fobj, filename, mmap_mode) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 506, in _unpickle obj = unpickler.load() File "/usr/lib/python3.8/pickle.py", line 1212, in load dispatchkey[0] File "/usr/lib/python3.8/pickle.py", line 1537, in load_stack_global self.append(self.find_class(module, name)) File "/usr/lib/python3.8/pickle.py", line 1579, in find_class import(module, level=0) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/init.py", line 81, in <module> from . import check_build # noqa: F401 File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/__check_build/__init.py", line 50, in <module> raise_build_error(e) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/check_build/__init.py", line 31, in raise_build_error raise ImportError( ImportError: libgomp-a34b3233.so.1.0.0: cannot open shared object file: No such file or directory
Contents of /home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/check_build: setup.py _check_build.cpython-38-x86_64-linux-gnu.so__init.py pycache
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run python setup.py install
or
make
in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
This happened after I did that
Traceback (most recent call last): File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/check_build/__init.py", line 48, in <module> from ._check_build import check_build # noqa ImportError: libgomp-a34b3233.so.1.0.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "./manage.py", line 22, in <module> main() File "./manage.py", line 18, in main execute_from_command_line(sys.argv) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/init.py", line 446, in execute_from_command_line utility.execute() File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/init.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/base.py", line 414, in run_from_argv self.execute(args, cmd_options) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/base.py", line 460, in execute output = self.handle(args, options) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/base.py", line 98, in wrapped res = handle_func(*args, kwargs) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 91, in handle self.check(databases=[database]) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/management/base.py", line 487, in check all_issues = checks.run_checks( File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/checks/urls.py", line 14, in check_url_config return check_resolver(resolver) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/checks/urls.py", line 24, in check_resolver return check_method() File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/urls/resolvers.py", line 480, in check for pattern in self.url_patterns: File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/utils/functional.py", line 49, in get res = instance.dict[self.name] = self.func(instance) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/urls/resolvers.py", line 696, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/utils/functional.py", line 49, in get res = instance.dict[self.name] = self.func(instance) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/urls/resolvers.py", line 689, in urlconf_module return import_module(self.urlconf_name) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 848, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/Anuj4388/RealEstateApp/real_estate/urls.py", line 5, in <module> from listings.views import ( File "/home/Anuj4388/RealEstateApp/listings/views.py", line 16, in <module> reloadModel = joblib.load('./models/pipeline1.pkl') File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 587, in load obj = _unpickle(fobj, filename, mmap_mode) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 506, in _unpickle obj = unpickler.load() File "/usr/lib/python3.8/pickle.py", line 1212, in load dispatchkey[0] File "/usr/lib/python3.8/pickle.py", line 1537, in load_stack_global self.append(self.find_class(module, name)) File "/usr/lib/python3.8/pickle.py", line 1579, in find_class import(module, level=0) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/init.py", line 81, in <module> from . import check_build # noqa: F401 File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/__check_build/__init.py", line 50, in <module> raise_build_error(e) File "/home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/check_build/__init.py", line 31, in raise_build_error raise ImportError( ImportError: libgomp-a34b3233.so.1.0.0: cannot open shared object file: No such file or directory
Contents of /home/Anuj4388/.virtualenvs/RE-env/lib/python3.8/site-packages/sklearn/check_build: setup.py _check_build.cpython-38-x86_64-linux-gnu.so__init.py pycache
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run python setup.py install
or
make
in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
There could be one of 2 things going on here: 1. You updated your system image and did not rebuild your virtualenv afterwards, so it's using a broken virtualenv 2. You are using a pickle from a different machine or environment. In general, unless you really know what you're doing with pickles, you cannot transfer them between machines/environments.
I fully completed a django project and made a requirements.txt file before uploading. After upload, i changed the path of pkl file to that in the server. on installing the requirements file, it says requirement already satisfied. But on running there's the above error. What should I do now? Try reinstalling venv?
It looks like your pickle file may require a library that is not installed on PythonAnywhere, so you will not be able to use that pickle file on PythonAnywhere.