ImportError: No module named pytz
xxx@hostname:/opt/xx/cc$ python manage.py runserver 0.0.0.0:
Traceback (most recent call last):
File "manage.py", line , in <module>
from django.core.management import execute_from_command_line
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/core/management/__init__.py", line , in <module>
from django.core.management.base import (
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/core/management/base.py", line , in <module>
from django.db.migrations.exceptions import MigrationSchemaMissing
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/db/migrations/__init__.py", line , in <module>
from .operations import * # NOQA
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/db/migrations/operations/__init__.py", line , in <module>
from .fields import AddField, AlterField, RemoveField, RenameField
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/db/migrations/operations/fields.py", line , in <module>
from django.db.models.fields import NOT_PROVIDED
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/db/models/__init__.py", line , in <module>
from django.db.models.aggregates import * # NOQA
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/db/models/aggregates.py", line , in <module>
from django.db.models.expressions import Func, Star
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/db/models/expressions.py", line , in <module>
from django.db.backends import utils as backend_utils
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/db/backends/utils.py", line , in <module>
from django.utils.timezone import utc
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.3-py2.7.egg/django/utils/timezone.py", line , in <module>
import pytz
ImportError: No module named pytz
安装
pip install pytz
再次报错
xxx@hostname:/opt/xx/cc$ pip install pytz
Downloading/unpacking pytz
Downloading pytz-2019.1-py2.py3-none-any.whl (510kB): 510kB downloaded
Installing collected packages: pytz
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line , in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line , in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line , in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line , in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line , in move_wheel_files
pycompile=self.pycompile,
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line , in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line , in clobber
os.makedirs(destsubdir)
File "/usr/lib/python2.7/os.py", line , in makedirs
mkdir(name, mode)
OSError: [Errno ] Permission denied: '/usr/local/lib/python2.7/dist-packages/pytz-2019.1.dist-info' Storing debug log for failure in /tmp/tmpbGaHeV
使用sudo权限
sudo pip install pytz
安装成功
xxx@hostname:/opt/xx/cc$ sudo pip install pytz
Downloading/unpacking pytz
Downloading pytz-2019.1-py2.py3-none-any.whl (510kB): 510kB downloaded
Installing collected packages: pytz
Successfully installed pytz
Cleaning up...
xxx@hostname:/opt/xx/cc$
参考:
https://blog.csdn.net/qq_38157974/article/details/78521088
ImportError: No module named pytz的更多相关文章
- 【问题解决方案】ImportError: No module named 'openpyxl'/‘xlrd’
背景: 在jupyter notebook to_excle: 运行将dataframe保存为excel文件 df.to_excel('dataframe.xlsx') 时报错openpyxl rea ...
- 【原创】大叔经验分享(11)python引入模块报错ImportError: No module named pandas numpy
python应用通常需要一些库,比如numpy.pandas等,安装也很简单,直接通过pip # pip install numpyRequirement already satisfied: num ...
- ImportError: No module named 'requests'
补充说明: 当前环境是在windows环境下 python版本是:python 3.4. 刚开始学习python,一边看书一边论坛里阅读感兴趣的代码, http://www.oschina.net/c ...
- python3中用HTMLTestRunner.py报ImportError: No module named 'StringIO'如何解决
python3中用HTMLTestRunner.py报ImportError: No module named 'StringIO'的解决方法: 1.原因是官网的是python2语法写的,看官手动把官 ...
- Ubuntu: ImportError: No module named xgboost
ImportError: No module named xgboost 解决办法: git clone --recursive https://github.com/dmlc/xgboost cd ...
- gdb 调试出现 ImportError: No module named 'libstdcxx'
在emacs使用gdb调试程序,出现错误 , in <module> from libstdcxx.v6.printers import register_libstdcxx_printe ...
- 关于python3.X 报"import urllib.request ImportError: No module named request"错误,解决办法
#encoding:UTF-8 import urllib.request url = "http://www.baidu.com" data = urllib.request.u ...
- virtualenv中ImportError: No module named django
问题现象:在代码py文件中,import django 报错,但是在python shell中直接执行这个语句没错, 网上搜索了下,自己测试了下,确定原因是由于使用了python中的virtualen ...
- win7下python3.4 ImportError: No module named 'MySQLdb'错误解决方法
首先,安装PyMySQL C:\Users\fnngj>python -m pip install PyMySQL 执行以下命令会报错: ImportError: No module named ...
随机推荐
- (十五)SpringBoot之使用Redis做缓存数据
一.添加Redis依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns=" ...
- Java BinarySearch
Java BinarySearch /** * <html> * <body> * <P> Copyright 1994-2018 JasonInternation ...
- springboot mvc自动配置(三)初始化mvc的组件
所有文章 https://www.cnblogs.com/lay2017/p/11775787.html 正文 在springboot mvc自动配置的时候,获得了DispatcherServlet和 ...
- document对象详解
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD ...
- Vue字符串padStart和padEnd方法
padStart()用于头部补全,padEnd()用于尾部补全. 'a'.padStart(3, '0') // '00a' 'x'.padEnd(5, 'ab') // 'xabab' 'x'.pa ...
- K2 BPM_“选BPM还是RPA?”,这不是一道单选题_全业务流程管理专家
在我们和企业讨论流程自动化的时候,经常会被问到一个问题,“公司目前正在调研市面上的业务流程自动化产品,我们已经把选择范围缩小到了BPM和RPA之间.我们应该怎么选择?BPM能做的好像RPA都能做到.” ...
- 《形式化分析工具Scyther性能研究》------摘抄整理
本篇论文的主要创新点在--------使用 Scyther工具发现对部分 KCI攻击搜索出现漏报的现象,并给出了存在的原因, 介绍了 形式化分析工具 AVispa全称是 Automated V ...
- int类型按字节打印输出
今天在项目编程中,遇到一个问题,u32类型的参数,要赋值给一个u8 array[3],想用memcpy()函数进行赋值,由于类型大小不一致,一时不知道怎么做,经过查找,得以解决.说明如下; 项 ...
- python3 Pandas
一.Pandas 1.Python Data Analysis Library 或 pandas 是基于NumPy 的一种工具,主要用于数据处理(数据整理,操作,存储,读取等) 2.http://pa ...
- DeviceSupport 路径
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSuppor