Modify the working directory in pycharm settings
Path:
file | settings | build, execution, deployment | console | Python console
Fill in the python installation directory in the working directory and restart the python console
Modify the working directory in pycharm settings
Path:
file | settings | build, execution, deployment | console | Python console
Fill in the python installation directory in the working directory and restart the python console
G:\ESP32\esp-idf-release-v4.3>pip install virtualenv
Collecting virtualenv
Downloading virtualenv-20.7.2-py2.py3-none-any.whl (5.3 MB)
|█ | 174 kB 4.5 kB/s eta 0:18:56ERROR: Exception:
Traceback (most recent call last):
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher
yield
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\http\client.py", line 459, in read
n = self.readinto(b)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\http\client.py", line 503, in readinto
n = self.fp.readinto(b)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\base_command.py", line 173, in _main
status = self.run(options, args)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\req_command.py", line 203, in wrapper
return func(self, options, args)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\commands\install.py", line 315, in run
requirement_set = resolver.resolve(
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 472, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 341, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 151, in __bool__
return bool(self._sequence)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 140, in __bool__
return any(self)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 128, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 32, in _iter_built
candidate = func()
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 204, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 295, in __init__
super().__init__(
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 156, in __init__
self.dist = self._prepare()
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 227, in _prepare
dist = self._prepare_distribution()
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 305, in _prepare_distribution
return self._factory.preparer.prepare_linked_requirement(
File "g:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\operations\prepare.py", line 508, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel
Later, add the path of Python to the system variable
Problem description
In items. Py
, customize the item method.
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class MyspiderItem(scrapy.Item):
# define the fields for your item here like:
name = scrapy.Field()
title = scrapy.Field()
desc = scrapy.Field()
RD_achievements = scrapy.Field()
We need to introduce this method into the sweep, which is the item method defined by ourselves in the sweep, but we need to reference it in the spider in the sweep, so we need to add a string of code to change our introduction method.
Error reported in pychart from myspyder.items import itcastitem
:
Original import method:
import scrapy
from crawlAdvanced.myspider.myspider.items import MyspiderItem
"""
scrapy crawl itcast --nolog
"""
from crawlAdvanced.myspider.myspider.items import MyspiderItem ModuleNotFoundError: No module named 'crawlAdvanced'
Solution 1
Change from myspider.items import myitem
to from.. items import myitem
In a package, peers use .
and parents use ..
Maybe the computer doesn’t know which file you’re talking about. After all, the two file names are the same( I don’t understand. I hope the boss can correct it!)
scrapy startproject mySpider
scrapy crawl mySpider
scrapy crawl mySpider -o teachers.json
Solution 2
If the error is still reported, you can refer to the following methods: (my error is solved by using the above method)
# -*- coding: utf-8 -*-
#The original python method of introducing scrapy class is wrong, please reintroduce it with this method
from __future__ import absolute_import
# is the above code
import scrapy
from selenium import webdriver
from scrapy_splash import SplashMiddleware
from scrapy_splash import SplashRequest
import pymysql
from ..item360 import Jc360Item
Error reported:
resolvent:
1、 Install the third-party library directly on the command page
pip install xxxxxx
2、 Select interpreter setting in the lower left corner of pychart, click the plus sign, enter the name of the third-party library, and then click Install pakage in the lower left corner to install.
3、 The 2. X version of tensorflow does not support many third-party libraries. I have tried many methods, but I still think it is the most direct and effective (simple and crude) to install the 1. X version directly. Correspondingly, you may need to downgrade numpy because the installed tensorflow version and numpy version do not match.
Uninstall tensorflow first:
pip uninstall tensorflow
To install a new version:
pip install tensorflow1.xx
Check the applicable version of pycharm, and then install:
pip install tensorflow==1.14 -i https://pypi.douban.com/simple
After running the code, an error is reported indicating that the numpy version does not match:
For example, I report an error: futurewarning: passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,))/'(1,)type’. _ np_ qint32 = np.dtype([(“qint32”, np.int32, 1)])
Recommended installation: or other version
pip install numpy==1.16.0
Normal operation after.
Errors are reported as follows:
Solution:
Reason: use tensorflow1 instead of tensorflow2.
Check the tensorflow version information first:
pip list
Then add the following code at the beginning of the code:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
Problem Description:
After switching a new project, the installation of pyGame package fails and prompts that you cannot
install pyGame in Python 3.8 (py)_ xiaoxiaole) (E:\homestead\py_ Xiaoxiaole/venv/scripts/python. Exe) to set up the python SDK
this SDK appears to be invalid.
Solution:
py_ Xiaoxiaole this project has just been deleted. I don’t know why this interpreter is selected by default
Select all to display
select the above Python SDK. If it is not available, a new one can be added
when there is an available Python SDK
the pyGame package is successfully installed again and the invalid Python SDK is deleted.
Background of the problem
When changing 32-bit Python to 64 bit, this problem suddenly appeared. I was so confused that PIP list
PIP install
couldn’t be used. I made a mistake
Solution:
first execute the command: Python - M ensurepip -- default PIP
Download get-pip.py at https://bootstrap.pypa.io/get-pip.py After entering, it is directly code, so you need to create a new get-pip.py file, copy and paste it, and finally enter the directory where the get-pip.py file is located from the command line CMD, Execute command: Python get pip. Py
note that permission error may be reported when executing this step. At this time, Python get pip. Py -- user
should be executed
Let’s go on
How to enter the directory where the get-pip.py file is located, you can follow the steps below in general windows
Postscript D: , then enter CMD, enter
D:
and then copy the directory of the file, paste enter, my file is D: + enter
After checking, it seems to say that PIP version 20. Has this problem, but PIP version 21. Is gone. Maybe there is a bug in the previous version
plugin requires missing class loader for ‘Python’
Original Cause Solution
Original cause
Remove the original pycharm on linux, reinstall tar.zip, and run pycharm.sh in the bin directory and get an error
solve
The reason for this is that there are residual files left over when removing pycharm.
After deleting the ~/.local/share/JetBrains and ~/.cache/JetBrains folders, re-run pycharm.sh and you're good to go.
I like interactive programming. After the PY file is running, I can directly enter the variable name and view the variable value without entering the print function to print the variable or enter some small commands, So I think Python console is at least better than “rigid” console.
1. Run edit configurations
2. Click “wrench”
3. Check “run with Python console” and then click “OK”
4. Create a new project new Python file, Only new project is the default setting)
if you don’t like Python console constantly creating new tabs every time you run, you can set the following
5. File settings
6. Check the red box “√” in build, execution and deployment console
Forebay:
Open pychar software help – & gt; Edit custom VM options… File, open pycharm64.exe.vmoptions file, add
– javaagent:C :\Program Files\JetBrains\PyCharm2019.3.4\bin\JetbrainsCrack-release-enc.jar
Close the software and re open it to report an internal error
resolvent:
You can open the. Pycharm2019.3 folder (the version you downloaded) and delete it
PS: let’s take a look at the problem that win10 pychar can’t open and double-click no response
Pychar still can’t be opened. Enter the CMD as an administrator, enter the following command, and restart the computer;
netsh winsock reset
In the search box of the computer, enter windows power shell
Restart the computer, and then open pychar software, you can work normally
div>
The GIT command has been introduced in previous blog posts. But for some scenes, it is still a little strange to use
git command git introduction and common command list
[scenario 1] pull the remote git warehouse branch to the local (this branch does not exist locally)
# recommand method
git fetch
# git checkout Remote branch name (dev is the example branch name)
git checkout dev
git pull
# other method (Not recommand)
git fetch
# git checkout -blocal branch name origin/remote branch name # actually associates the remote branch to the local branch
git checkout -b dev origin/dev
git pull
git push
[scenario 2] push the newly created local branch to the remote git warehouse
[scenario 3] solve [remote rejected] intg/dev – & gt; Intg/dev (hook declined) problem
# Check out the new local branch. The contents of the new branch are identical to the contents of the previous branch. When it is created, it will automatically switch to the new branch
git checkout -b new branch name
# [Suggestions] After modifying or creating a new file, it is recommended that you run the following two lines before committing
# Execute the command to resolve the [remote rejected] intg/dev -> intg/dev (hook declined) issue
git stash
git pull --rebase
git commit -m "comments in quotes for commit"
git push --set-upstream origin branch name
Microsoft Visual C + + 14.0 is required
Solution 1
Install Microsoft Visual C + + build tools
directly by default. After the installation, install paddlex in pychar, and no error will be reported
Solution 2
After installing with PIP command, import pychar
and open pychar’s view – & gt; tool windows – & gt; Terminal (or use the shortcut key Alt + F12)
in the command window, enter PIP install padding code>
PIP command. By default, it is installed in the directory of Python's site packages (for example, my file is f:: (Python), 3.7.7-64, lib, site packages)
copy these files in the directory to pychar's external directory In site packages under libraries, you can import paddlex to use