First of all, I met this error report
>>> import WindPy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: source code string cannot contain null bytes
It’s probably the coding problem. The solution is to use vscode to open windpy.py (just search in the computer). There is a coding button in the lower right corner. Now the UTF-8 is displayed. Originally, it seems to be utf-16le. The Chinese displayed in the text is still garbled. Click this button and select save in this format.
And then there’s the following error report
SyntaxError: 'gbk' codec can't decode byte 0xbd in position 2985: illegal multibyte sequence
The solution is to delete all the comments.
It’s the last mistake.
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\**myfiles**\\Python\\Python38\\site-packages\\WindPy.pth'
The solution is to look for open in windpy.Py and comment all the following lines
Change the line that reads the library to the address of windpy.dll
# pathfile=open(sitepath)
# dllpath=pathfile.readlines();
# pathfile.close();
# sitepath=dllpath[0]+"\\WindPy.dll"
c_windlib=cdll.LoadLibrary('D:\\**install_WIND_files**\\x64\\WindPy.dll')
Just fine. I hope I can help you not to fall into the pit
Read More:
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- How to Solve Python ImportError: cannot import name UnrewindableBodyError
- How to Solve Python Importerror: DLL load failed: unable to find the specified program using tensorflow
- How to Solve Python Pandas Read or Import Files Error
- How to Solve Python3.9 Install pycrypto Error
- How to Solve Python Libsm. So. 6 error
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- How to Solve Python picamera and raspistill error
- How to Solve Python ShapeFile.writer Error for Beginners
- How to Solve Python Xlwt ValueError: More than 4094 XFs (styles)
- How to Solve Python AttributeError: ‘dict’ object has no attribute ‘item’
- Python: How to Solve mysqlclient Install Error in Mac
- Python: How to Solve multiprocessing module Error in Windows
- [Solved] Python Using or importing the ABCs from ‘collections‘ instead of from ‘collections.abc‘ is deprecate
- Python: How to Auto Add Watermark to PDF
- VScode: How to Solve Pylance Error (pip Library Files Installed)
- How to Solve Error: RuntimeError CUDA out of memory
- PyCharm: How to Solve Tensorflow_datasets Import Error
- How to Solve Turtle_tf Error in ROS
- Python: How to Disable InsecureRequestWarning error