当前位置:网站首页>Pypharm uses, and the third-party library has errors due to version problems

Pypharm uses, and the third-party library has errors due to version problems

2022-07-07 23:48:00 Black faced boy

Recently started deep learning , Due to Python2 and Python3 Version incompatibility has caused some problems

1、PIL Installation failed

Python3 It should be pillow But still import

from PIL import Image 

Here is a quick way to install third-party libraries ,Pycharm It will automatically remind you to install the required libraries , Click to . To improve speed, use mirroring , Tsinghua image is used here . Click the plus sign in the figure below , Manually search third-party libraries .

Click on the position shown in the figure , Modify the download path of the third-party library to :Simple Index

 2、scipy.misc There is no hint imsave

 resolvent , hold scipy Change to imageio
import imageio
imageio.imsave(new_filename, pic)

3、 In the use of writer.writerow() When prompted, you should enter something like bytes Type, not str type

Or because writer.writerow() Generate blank lines , Use the following methods

rnacsv = open(rnafile,'w',newline='')
writer = csv.writer(rnacsv)
m = len(rnastructure)
for i in range(m):
    writer.writerow(rnastructure[i])

4、pycharm Breakpoint settings

Click in front of each line , Click the green Ladybug button when running

原网站

版权声明
本文为[Black faced boy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130555147209.html