Troubleshooting of errors in the installation and use of scienceplots
Configure
Python 3.8.5
Anaconda
Spyder 4
Spyder editor has a good graphical interface. The drawn graphics are directly fed back in the interface. When the terminal and pycharm run Python drawing, the image will be displayed only after plot
therefore, I am used to using Spyder.
1. Scienceplots installation
(1) The scienceplots toolkit needs to install latex in advance. If latex has been used before, it is ignored. It is recommended to download and install the miktex link on the official website: link.
this step is very important. Installing latex in CONDA is not enough. You must install latex in win10. See the next section for details.
(2) Install scienceplots
GitHub link: link. Provides three methods, all of which are OK.
The easiest way to install SciencePlots is by using `pip`:
```bash
# to install the lastest release (from PyPI)
pip install SciencePlots
# to install the latest commit (from GitHub)
pip install git+https://github.com/garrettj403/SciencePlots
# to clone and install from a local copy
git clone https://github.com/garrettj403/SciencePlots.git
cd SciencePlots
pip install -e .
(3) Test it. It can be used to indicate that the installation is successful.
import matplotlib.pyplot as plt
plt.style.use('science')
fig, axe = plt.subplots(2, 2, figsize=(5,5))
2. Problems encountered
Two main errors were encountered:
File "C:\Users\dell\anaconda3\lib\subprocess.py", line 1307, in _execute_chi
RuntimeError: Failed to process string with tex because latex could not be found)
Two errors occur in sequence. Error reporting means that the first error directly leads to the second error… I thought it was a kernel error. I changed the bug crazily. Anaconda uninstalled and reinstalled. Jupyter, spyder editor, xlrd, Matplotlib, scienceplots and other packages uninstalled and reinstalled crazily. Finally, I finally determined that these things were ok…..
During installation, I noticed the prompt in read me that latex needs to be installed in advance. I thought I had installed latex in anaconda, but I didn’t pay attention to this sentence. Finally, I tried all the methods. I suddenly realized that latex should be installed under win. Sure enough, there is no error when running the drawing code again after installing miktex. After running for a few seconds, you will be prompted to install some real macros in the latex package. After installation, you can run!
Really special pit… It took so long to fix the bug. In fact, it’s just such a small problem. Reflect on yourself. In the future, you must think more seriously!
Read More:
- Troubleshooting of errors in installing elasticsearch
- Troubleshooting of Ubuntu wrk installation error
- There are errors 1304 and 2350 FDI server errors in ArcGIS Server installation
- Solutions to errors in geopandas installation
- Troubleshooting of samba error in Linux configuration startup
- Installation and use of R language ggmap package
- Installation and use of graphviz under mac
- There will be row spacing problems in algorithm use in latex. Please use the ‘setstretch {1.35}
- Oracle 12C installation process related errors and Solutions
- Installation and use of XmR stak CPU
- Installation and use of OpenGL based on CodeBlocks
- Ubuntu 12.04 installation and use of airtrack ng tutorial
- Error 1500. Another program is in progress. You must complete another installation before continuing with this installation.
- Troubleshooting of “disk I / O error” after startup
- Solve the problem of failure in installation of golang plug-in dependency in vscode
- Summary of errors in installing texlive2017
- SteamVR error code 108/203/208/301/306/308/400/405 troubleshooting method
- Pychart remote debugging display picture, tkagg error report troubleshooting
- MySQL error code ‘1064’ troubleshooting process
- Troubleshooting of ROS rosdep init / update