Tag Archives: pycharm

The problem of: modulenotfoundererror: no module named ‘pyqt5’ appears in pychar using pyqt5

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

The problem that pychar does not recognize pyqt5 is shown in the figure. When pyqt5 is referenced, the error “module not found error: no module named ‘pyqt5′” is displayed

First, make sure that pyqt5 has been installed successfully

In the path of Python/python36/lib/site packages, see if there are pyqt5 related libraries. If pyqt5 is successfully referenced through Python commands, it means that pyqt5 is installed without problems. Python environment variable configuration is generally no problem, very few, if there is, it can not run

The latest version of pychar creates a python virtual environment by itself. By default, the third-party library you installed is not added to it, which causes this problem. In addition, when you create a new project, the label of project iterpreter is hidden and you can’t notice it. You need to open it manually, as shown in the following figure

Solution 1: when creating a new project, check the two boxes as shown in the figure below to load the third-party library

In this way, a pile of things will be loaded when the project is created. Another way is to use the following existing interpreter to handle it. Click the configuration button

If you have already built a project and don’t want to repeat the existing work, don’t worry, there are still ways

Find the external libraries at the end of the existing project, then find the venv directory, and change the following parameters in the pyvenv.cfg file to true

include-system-site-packages = true

It’s done

If you don’t find pyvenv.cfg, in your settings – > In the directory of projiect interpreter, find the file, modify it with Notepad, and then save it

Pycharm Error: ImportError: No module named model_selection

first of all, I want to explain that I have this problem because I need to use train_ test_ Split method, the specific reference is:

from sklearn.model_selection import train_test_split

this error occurred:

ImportError: No module named model_selection

I checked on the Internet and found out the cause of the problem. One thing Dashen gave me was that there was a problem with my sklearn version, which was train before version v0.18_ test_ Split is placed in cross_ In the validation module, now, there are two solutions to this problem:

Method 1.

will:

from sklearn.model_selection import train_test_split

TO:

from sklearn.cross_validation import train_test_split

 

Method 2.

Upgrade sklearn to v0.18 or above

If your pychar compilation environment is Anaconda’s python, enter
in the anaconda prompt operation line

The CONDA update scikit learn command updates the version of sklearn. Before updating, you will be prompted to what version to update

Or enter PIP install — upgrade scikit learn to update the version
as well

 

 

 

Pycharm cannot import the third-party library no module named urllib3

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Urllib3 is a powerful, well-organized Python library for HTTP clients. If we find that urllib3 library cannot be used in the new project created by pychar editor, we can do the following operations:

The error is as follows:

We can’t find this urllib3 file in the site packages of Lib in pychar project

So, let’s continue:

1. First confirm whether urllib3 has been installed on the computer. If not, install urllib3 through PIP install urllib3 in the CMD command

If the installation is successful, the URL lib3 folder will exist in lib/site packages in the python program installation directory. For example, the address on my side is: C:: (users, administrator, appdata, local programs, python, python37, lib, site packages, urlib3

2. When creating a new program, check inherit global package. Inherit global site-packages

3. At this time, we can see the class package of the project

At this time, we can find that there is one more class package. There are two site packages in total

Open the last site packages, and you can see that urllib3 is imported successfully

Then let’s look at the code:

There’s no red wavy line

Pychar can’t install the third-party library, the solution of error code non zero exit code (1)

Pychar version 2019.3

Installation failed. Suggested solution: try to run this command from the system terminal. Make sure that you are using the correct version of ‘pip’, which is installed for the Python interpreter at ‘C: \ “users \” g \ “desktoplgianfeng \” venv \ “scripts \” python

You know, when you create a project with pychar, there will be a virtual space, which is different from the space where you installed python

For example: you create a project

This venv is your virtual space. There will be a separate Python and exe interpreter in the script folder

Since pychar was upgraded to 2019, there have always been some strange problems

Now the solution

Let’s talk about the problem first. This is mainly a problem of upgrading PIP through a py module

Let’s first open the folder address of the virtual space

You’ll find that we’re already in this directory, and check whether it’s the latest version of PIP through PIP – V

See this file?Use it to upgrade pip

Then start the upgrade: PIP install — upgrade PIP – I https://pypi.tuna.tsinghua.edu.cn/simple/

-I behind is Tsinghua’s source, guarantee the speed

Look at the PIP version. It has been updated

And then install the third-party library

Error interpreter field is empty when installing pychar to create a new project. Run the python program

Detailed map traversal, teach you to master the complex gremlin query debugging method>>>

Error interpreter field is empty when installing pychar to create a new project. Run the python program

September 13, 2018 17:08:43 flyingong read 518 more

Personal category: software installation

Copyright notice: reprint casually and indicate the source. If you don’t make money, you just make friends. https://blog.csdn.net/a1194110603/article/details/82690932

Reason: the Python interpreter is not installed

Steps to install Python:

1. Download the installation package from the official website, and choose the latest version

https://www.python.org/downloads/

2. To install python, refer to the Python installation section of the following blog for specific steps, and remember the installation path:

https://www.cnblogs.com/weven/p/7252917.html

3. Start pychar, create a new project, and select the directory to install Python in the blue box to find the location of python.exe

4. Right click New Python file in the folder you created, create a python file, and double-click to program

5. Input command

print('Hello World !');

Then click as shown in the figure and select the programming file to run the first Python program. After that, you can click the right triangle to run directly

At present, mobile phones are popular ways to make money. People who know Huada have already made money crazy! Xinzhou Trade Co., Ltd

Import pandas encountered no module named pandas in pychar

Detailed map traversal, teach you to master the complex gremlin query debugging method>>>

1. If pandas library has not been installed from, under Windows system, use terminal CMD – > CD, enter the application with PIP installation, and run PIP install panda to install. The PIP version here should be the same as the pychar compiler version

After installation, you can use the panda library

2. If it has been installed before, no module named pandas will appear in the project, and the project structure will add the site packages directory

E:\Python27\python-3.7.2\Lib\site-packages

(1) . select File – > settings—> project:pythonWork —> project structure

(2) . select add content root on the right

(3) . select the folder (site packages folder under project interpreter)

(4)、mark as: sources

(5)、apply

Click OK to solve the problem

Solve the problem of no Python interpreter selected after the initial installation of pychar

Detailed map traversal, teach you to master the complex gremlin query debugging method>>>

solve the problem of no Python interpreter selected after the initial installation of pychar

Reference article:

(1) Solve the problem of no Python interpreter selected after the initial installation of pychar

(2) https://www.cnblogs.com/nofacemale/p/5368766.html

Let’s make a note.

Pychar error report solution: error:please select A valid Python interpreter and some basic settings

Detailed map traversal, teach you to master the complex gremlin query debugging method>>>

Problem Description:

Before the installation of the PC is Python 2, later work needs to be converted to Python 3. Then, when running the program of Python 2 with pychar, we find that the source program runs with an error (syntax error)

error:please select a valid Python interpreter

Cause of the problem:

When pychar imported the source project, it did not choose to run the python program

Solution:

1. Change the settings of pychar
Open settings (Ctrl + Alt + s) or file > Settings, open the configuration box, as shown in the following figure:

2. Enter interpreter in the query box to query

Pychar permanent activation method

1. Get activation code address

   http://idea.lanyus.com/

2. Open the hosts file and add 0.0.0 account.jetbrains.com to the last line of the file

Open pychar, click files in the upper left corner, and select setting: set menu bar font

Set the scroll wheel to change the font size

Open pychar, click files in the upper left corner, and select setting — > Search for mouse — select general