Home > Backend Development > Python Tutorial > Detailed graphic explanation of twisted module installation in python

Detailed graphic explanation of twisted module installation in python

高洛峰
Release: 2017-03-15 15:24:39
Original
2656 people have browsed it

Twisted is an event driven network framework.

I recently started to learn about Twisted. First I must install the twisted module.

But when executing under cmd: pip install twisted

, the following problem occurred: "error:Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)

My computer is a pyhton3.4 environment (python2.7 is also available), VC++ 10.0 is not installed, so according to the error prompt, I have to install VC++ 10.0?

But I don’t want to~, so I searched a lot on the Internet and read many other people’s methods. Finally, I heard a sentence while watching the learning video: "The twisted module is lower-level, complex, and has not been fully transplanted to Python3.×"

Okay, anyway. My computer has python2.7, so I will use version 2.7

##Soswitched from python3.4 to python2.7 under the pycharm tool, and successfully installed twisted. Module!!

Detailed graphic explanation of twisted module installation in python

Problem: import error no module `twisted `


So I started to use the Python2.7 environment when I started to learn about the twisted framework. It prompted when running a small program (need to execute the command under cmd) import error no module `twisted`

#But I have installed the twisted module in Python2.7! And there is no error when running other programs to import twisted!! (A bit Suspicious life~)

So I wonder if it has something to do with operating under cmd? Python2.7 is definitely able to import twisted successfully, but before I imported Python3.4, it was not possible. Successful. So could it be that the cmd command I executed was running under Python3.4?

##Execute the python command and check the python version. Damn it!

I have switched to the python2.7 version in pycharm. The 3.4 version should not be displayed!! (A little suspicious of life again~)

Detailed graphic explanation of twisted module installation in python

## I checked the directory files shown in the two pictures below on my computer:

Detailed graphic explanation of twisted module installation in python

Detailed graphic explanation of twisted module installation in pythonC:\python34 There is a python.exe and a python3.exe. (There are two .exes, which is very strange.

Remember that there was only one when installing python3.4 python3.exe, later I seemed to rename it and created an extra python.exe)

So when I executed the python command and checked the python version, C:\python34 was called python.exe in the directory instead of python.exe in the C:\python27 directory? ?

So I

delete

the python.exe

## in the C:\python34 directory

Execute the command again: pythonDetailed graphic explanation of twisted module installation in python

Detailed graphic explanation of twisted module installation in python

Oh my god, my guess is right!!

Run a small program again (needs to be under cmd When executing the command), it can run without prompting import error no module `twisted`

Summary: Be careful when installing, please do not rename

The above is the detailed content of Detailed graphic explanation of twisted module installation in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template