Anaconda

Anaconda paths broken after username change

最后都变了- 提交于 2021-01-05 11:53:42
问题 I just changed my username on Ubuntu (17.10) and my Anaconda packages are messed up. For instance, when I run conda in the terminal, I get the following error: bash: /home/<new username>/anaconda3/bin/conda: /home/<old username>/anaconda3/bin/python: bad interpreter: No such file or directory How can I fix this without reinstalling Anaconda3? 回答1: $ lv home/<new username>/anaconda3/bin/conda will show you the below. #!/home/<old username>/anaconda3/bin/python # -*- coding: utf-8 -*- . . . The

学习Linux 第五课

放肆的年华 提交于 2021-01-05 10:38:17
9月11日任务 2.1/2.2 系统目录结构 2.3 ls命令 2.4 文件类型 2.5 alias命令 2.1.1 、系统目录结构 [root @localhost ~]# ls / bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var /bin:存放普通用户常用的命令 /sbin:存放root用户命令 /boot:启动系统相关文件 /dev:系统特有的设备文件 /etc:存放所有系统管理所需要的配置文件和子目录,相当于windows的c:\windows目录 /home:用户的家目录 /lib:存放系统最基本的动态链接共享库,库文件 /media:一个媒介目录,默认空 /mnt:临时挂载目录,默认空 /opt:主机额外安装软件所设置的目录,一般为空 /proc:系统启动进程 /root:是root用户的家目录,相当于root用户的home /run:存放一些服务的pid /srv:存放的是服务启动之后需要提取的数据 /sys:存放硬件驱动程序相关的信息 /tmp:存放一些临时文件 /usr:类似于Windows下的program files目录 /var:存放不断扩充且经常修改的目录。包括日志文件与pid文件 比较常使用的目录有: /usr/bin/ /usr

Python爬虫学习

杀马特。学长 韩版系。学妹 提交于 2021-01-03 11:27:42
原博地址:http://blog.sciencenet.cn/blog-377709-1102168.html 超级好的博主,很详细,适合零基础学习。 Anaconda 下anaconda prompt:pip install pipenv 运行完后运行: pipenv install 安装软件包requests_html:pip install requests_html 读入网页加以解析抓取,需要用到的软件包是 requests_html 。 from requests_html import HTMLSession session = HTMLSession() #建立一个会话,让python作为一个客户端,和远端服务器交谈 url = 'https://www.jianshu.com/p/85f4624485b9' #输入爬取网址 r = session.get(url) #利用 session 的 get 功能,把这个链接对应的网页整个儿取回来 print(r.html.text)#我们告诉Python,请把服务器传回来的内容当作HTML文件类型处理。我不想要看HTML里面那些乱七八糟的格式描述符,只看文字部分。 获取网页中的所有链接 把返回的内容作为HTML文件类型,我们查看 links 属性: r.html.links 注释:看似不完整的链接,是相对链接,它是某个链接

Conda install screwed up my environment. Can I undo it?

北城余情 提交于 2021-01-03 04:32:32
问题 I tried installing rpy2 so that I could work with R files ( .rda ) using conda install -c r rpy2 , and it totally screwed up my environment. For example: 1) When I try importing pandas , I get this error: AttributeError: module 'pandas' has no attribute 'core' 2) When I try importing matplotlib , I get this error: AttributeError: module 'matplotlib' has no attribute 'artist' I wasn't having these issues before I installed this package. Is there a way to undo what I just did - as if I never

Conda install screwed up my environment. Can I undo it?

折月煮酒 提交于 2021-01-03 04:31:21
问题 I tried installing rpy2 so that I could work with R files ( .rda ) using conda install -c r rpy2 , and it totally screwed up my environment. For example: 1) When I try importing pandas , I get this error: AttributeError: module 'pandas' has no attribute 'core' 2) When I try importing matplotlib , I get this error: AttributeError: module 'matplotlib' has no attribute 'artist' I wasn't having these issues before I installed this package. Is there a way to undo what I just did - as if I never

Conda install screwed up my environment. Can I undo it?

会有一股神秘感。 提交于 2021-01-03 04:31:05
问题 I tried installing rpy2 so that I could work with R files ( .rda ) using conda install -c r rpy2 , and it totally screwed up my environment. For example: 1) When I try importing pandas , I get this error: AttributeError: module 'pandas' has no attribute 'core' 2) When I try importing matplotlib , I get this error: AttributeError: module 'matplotlib' has no attribute 'artist' I wasn't having these issues before I installed this package. Is there a way to undo what I just did - as if I never

Conda install screwed up my environment. Can I undo it?

依然范特西╮ 提交于 2021-01-03 04:30:38
问题 I tried installing rpy2 so that I could work with R files ( .rda ) using conda install -c r rpy2 , and it totally screwed up my environment. For example: 1) When I try importing pandas , I get this error: AttributeError: module 'pandas' has no attribute 'core' 2) When I try importing matplotlib , I get this error: AttributeError: module 'matplotlib' has no attribute 'artist' I wasn't having these issues before I installed this package. Is there a way to undo what I just did - as if I never

世界动态疫情地图Python轻松画

百般思念 提交于 2021-01-02 13:15:25
今天我们来看看如何绘制世界疫情动态地图。同样使用PyEcharts进行绘制,还没看过前几期使用PyEcharts绘制疫情地图文章的,可以通过以下链接查看 8行Python代码轻松绘制新冠疫情地图 动态新冠疫情地图Python轻松画 湖北动态新冠疫情地图Python轻松画 地图效果如下: 绘制世界疫情动态地图有个地方需要注意,就是要把国家标签隐藏起来,否则全部显示的话,那效果惨不忍睹,你们可以自己试试。 另外国家名要用英文名,为止,我还特意去找了一张国家名称对应表进行匹配处理。 数据是这样的,指标是新增确诊人数 长按识别下方二维码,并关注公众号 回复“DTX”获取案例数据 有了前面绘图经验,我们就直接上代码了 import pandas from pyecharts.charts import Map from pyecharts import options as opts from pyecharts.charts import Timeline data = pandas.read_excel('C:/Python/xgyq.xlsx',sheet_name='6', index_col='time') #取出国家列表 attr = data.columns.tolist() #统计数据条数 n = len(data.index) #定义每日地图绘制函数 def map

Python: pyinstaller打包exe(含file version信息)

只谈情不闲聊 提交于 2020-12-31 11:08:13
最近项目上一直都是用Spyder直接运行.py文件的方式来执行每日的自动化程序,每天都要手动去点击Run来执行一次,所以考虑把.py文件直接打包成exe,然后用windows的task schedule功能来让它自动每天运行。 用pyinstaller来打包exe文件,同时为了便于维护,给exe文件添加文件版本file version信息。 1. 安装pyinstaller 机器上的python环境是直接安装的Anaconda软件,所以直接打开“Anaconda Prompt”来安装pyinstaller,运行命令:pip install pyinstaller。(如果提示有其他相关的组件xxxx缺失,用相应的方式来安装就好: pip install xxxx) 2. 设置文件版本信息 为了方便版本管控,最好是给每次打包发布的exe文件设置文件版本信息——右键点击exe查看属性中的详情信息中可以看到版本信息。 方法一: 进入pyinstaller的此目录\PyInstaller\utils\cliutils\下(如果不知道路径可以通过去全盘查询cliutils来找到相应的文件夹,此处安利一款window上的文件查询小软件——Everything: https://www.voidtools.com/zh-cn/downloads/ ,查询速度超级快!) 你会看到如下几个文件:

Linux 学习第四天

Deadly 提交于 2020-12-31 10:06:05
Linux学习第四天 一、常用命令 1、tar (压缩、解压) A、添加压缩包 tar czvf 压缩包名称.tar.gz 源文件 B、添加压缩包 tar cjvf 压缩包名称.tar.bz2 源文件 C、解压压缩包 tzr xzvf 压缩包名称.tar.gz D、解压压缩包 tar xjvf 压缩包名称.tar.bz2 2、tr (转换文件中的字符) 3、grep (查找文件里符合条件的字符串) A、grep -n boot anaconda-ks.cfg (显示行号中包含 “boot” 字符串) 4、find (用来在指定目录下查找文件) A、find / (根目录全盘搜索) B、find / -name fstab (查找文件名为fstab) C、find / -user dream (查找dream用户文档) D、find / -user dream -exec cp -rf {} /root \; (查询用户文档并打包) 注:文章整理来自《linux就该这么学》作者刘遄 来源: oschina 链接: https://my.oschina.net/u/4339957/blog/3635761