国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Kinect系列1:(Windows環(huán)境配置)Python3+Pykinect2+KinectV2相機讀取彩色圖與深度圖

這篇具有很好參考價值的文章主要介紹了Kinect系列1:(Windows環(huán)境配置)Python3+Pykinect2+KinectV2相機讀取彩色圖與深度圖。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

前言:

python獲取深度相機信息,Python+KinectV2,Pykinect,Windows,數(shù)碼相機,計算機外設(shè)

Kinect是微軟在2009年公布的XBOX360體感周邊外設(shè)。它是一種3D體感攝影機,同時它導(dǎo)入了即時動態(tài)捕捉、影像辨識、麥克風(fēng)輸入、語音辨識、社群互動等功能。而相比Kinect V1,Kinect V2具有較大的紅外傳感器尺寸,并且(相對于其他深度相機)具有較寬闊的視場角,生成的深度圖質(zhì)量比較高。此外,Kinect V2的SDK非常給力,SDK中提供了同時最多進行六個人的骨架追蹤、基本的手勢操作和臉部跟蹤,支持 Cinder 和 Open Frameworks,并且具有內(nèi)置的Unity 3D插件。下面是Kinect V1和Kinect V2的一些對比。

KinectV1和V2性能參數(shù)對比
種類 V1 V2
彩色圖分辨率 640*480 1920*1280
深度圖分辨率 320*240 512*424
紅外圖分辨率 -- 512*424
深度檢測距離 0.4m~4m 0.4m~4.5m
垂直方向視角 57度 70度
水平方向視角 43度 60度

同時,相對V1版相機基本是通過C++進行讀取與開發(fā),V2版也提供了一些開源Python接口對相機進行讀取,如(Kinect/Pykinect2)。接著就可以方便地使用OpenCV、Open3D或深度學(xué)習(xí)等算法了。目前應(yīng)用Python開發(fā)KinectV2主要有三種思路:

A. Libfreenect2以及OpenNI2:此方法在ROS端配置比較方便(參考博客),但在Windows端配置比較復(fù)雜(參考博客)。且對UsbDk或libusbK和libfreenect2等文件通過Visual Studio編譯的過程依賴工具多,不同電腦總會出現(xiàn)各種問題,解決起來比較繁瑣。

B. Matlab(讀?。┖蚉ython的聯(lián)合編程:通過kin2工具箱(參考開源項目)調(diào)用C++封裝好的Kinect SDK,并通過Matlab和Python的實時通訊接口傳輸圖片。缺點是占用內(nèi)存大、傳輸延時大、調(diào)試復(fù)雜。

C. 應(yīng)用Pykinect2庫:通過開源的Pykinect2工具庫讀取,但數(shù)據(jù)方面只提供RGB和深度圖接口,且該庫是使用Python2開發(fā)。在應(yīng)用Python3的安裝和開發(fā)過程中會遇到一系列的問題,在本文中列出相應(yīng)的解決方案。

工作環(huán)境:

系統(tǒng):windows10家庭版

Anaconda版本:4.14.0

Python版本:3.8.12

IDE:Pycharm

安裝流程:

1、下載Kinect for Windows SDK2.0,并正確安裝至本機,打開Kinect Studio檢查安裝是否成功。參考博客

2、在Anaconda的Terminal下載Pykinect2庫:

pip install pykinect2 -i https://pypi.tuna.tsinghua.edu.cn/simple

3、進入Pykinect2(Github)下載最新庫,并把其中的這兩個文件替換(Anaconda所在路徑)\envs\(環(huán)境名稱)\Lib\site-packages\pykinect2下的同名文件。

python獲取深度相機信息,Python+KinectV2,Pykinect,Windows,數(shù)碼相機,計算機外設(shè)

此步驟可以解決這個報錯:

python獲取深度相機信息,Python+KinectV2,Pykinect,Windows,數(shù)碼相機,計算機外設(shè)

4、接下來會遇到這個報錯,此報錯是由于Pykinect2依賴庫comtypes連接的版本與最新版本不兼容。

python獲取深度相機信息,Python+KinectV2,Pykinect,Windows,數(shù)碼相機,計算機外設(shè)

此時需要重新安裝comtypes庫:

pip install comtypes==1.1.4 -i https://pypi.tuna.tsinghua.edu.cn/simple

5、接下來會遇到這個報錯,此報錯是由于該版本的comtypes庫是基于Python2編寫的,與現(xiàn)在環(huán)境的Python3版本不兼容。

python獲取深度相機信息,Python+KinectV2,Pykinect,Windows,數(shù)碼相機,計算機外設(shè)

此時需要將comtypes庫中用到的Python2文件轉(zhuǎn)換為Python3文件才能夠正常執(zhí)行,先找到Anaconda安裝路徑中的2to3.py文件,位于(Anaconda安裝路徑)\envs\(環(huán)境名稱)\Tools\scripts:

python獲取深度相機信息,Python+KinectV2,Pykinect,Windows,數(shù)碼相機,計算機外設(shè)

打開電腦cmd(Win+R),進入到對應(yīng)路徑下:

python獲取深度相機信息,Python+KinectV2,Pykinect,Windows,數(shù)碼相機,計算機外設(shè)

找到comtypes中報錯的文件路徑,使用2to3.py將其轉(zhuǎn)為Python3文件,例如輸入:

python 2to3.py -w D:\Anaconda\envs\paddle\lib\site-packages\comtypes\__init__.py

順序解決所有類似的報錯,此步驟涉及近10個文件,需要耐心重復(fù)執(zhí)行。執(zhí)行完后便可正常引用Pykinect2庫了。

6、編寫Python調(diào)用Pykinect2的讀取程序,此處參考(開源博客)中提供的示例代碼進行修改:文章來源地址http://www.zghlxwxcb.cn/news/detail-851194.html

#coding=utf-8
from pykinect2 import PyKinectV2
from pykinect2.PyKinectV2 import *
from pykinect2 import PyKinectRuntime
import numpy as np
import ctypes
import math
import cv2 as cv
import time
import copy

class Kinect(object):
    def __init__(self):
        self._kinect = PyKinectRuntime.PyKinectRuntime(PyKinectV2.FrameSourceTypes_Color | PyKinectV2.FrameSourceTypes_Depth | PyKinectV2.FrameSourceTypes_Infrared)
        self.depth_ori = None
        self.infrared_frame = None
        self.color_frame = None
        self.w_color = 1920
        self.h_color = 1080
        self.w_depth = 512
        self.h_depth = 424
        self.csp_type = _ColorSpacePoint * int(1920 * 1080)
        self.csp = ctypes.cast(self.csp_type(), ctypes.POINTER(_DepthSpacePoint))
        self.color = None
        self.depth = None
        self.depth_draw = None
        self.color_draw = None
        self.infrared = None
        self.first_time = True

    def get_the_last_color(self):
        if self._kinect.has_new_color_frame():

            frame = self._kinect.get_last_color_frame()

            gbra = frame.reshape([self._kinect.color_frame_desc.Height, self._kinect.color_frame_desc.Width, 4])

            self.color_frame = gbra[:, :, 0:3]
            return self.color_frame


    def get_the_last_depth(self):
        if self._kinect.has_new_depth_frame():

            frame = self._kinect.get_last_depth_frame()

            image_depth_all = frame.reshape([self._kinect.depth_frame_desc.Height,
                                             self._kinect.depth_frame_desc.Width])
            self.depth_ori = image_depth_all

            return self.depth_ori



    def get_the_last_infrared(self):
        if self._kinect.has_new_infrared_frame():

            frame = self._kinect.get_last_infrared_frame()

            image_infrared_all = frame.reshape([self._kinect.infrared_frame_desc.Height,
                                             self._kinect.infrared_frame_desc.Width])
            self.infrared_frame = image_infrared_all
            return self.infrared_frame



    def map_depth_point_to_color_point(self, depth_point):
        depth_point_to_color  = copy.deepcopy(depth_point)
        n = 0
        while 1:
            self.get_the_last_depth()
            self.get_the_last_color()
            if self.depth_ori is None:
                continue
            color_point = self._kinect._mapper.MapDepthPointToColorSpace(
                _DepthSpacePoint(511-depth_point_to_color[1], depth_point_to_color[0]), self.depth_ori[depth_point_to_color[0], 511-depth_point_to_color[1]])
            # color_point = self._kinect._mapper.MapDepthPointToColorSpace(
            #     _DepthSpacePoint(depth_point[0], depth_point[1]), self.depth[depth_point[1], depth_point[0]])
            if math.isinf(float(color_point.y)):
                n += 1
                if n >= 50000:
                    print('')
                    color_point = [0, 0]
                    break
            else:
                color_point = [np.int0(color_point.y), 1920-np.int0(color_point.x)]
                break
        return color_point


    def map_color_points_to_depth_points(self, color_points):
        self.get_the_last_depth()
        self.get_the_last_color()
        self._kinect._mapper.MapColorFrameToDepthSpace(
            ctypes.c_uint(512 * 424), self._kinect._depth_frame_data, ctypes.c_uint(1920 * 1080), self.csp)
        depth_points = [self.map_color_point_to_depth_point(x, True) for x in color_points]
        return depth_points

    #將彩色像素點映射到深度圖像中
    def map_color_point_to_depth_point(self, color_point, if_call_flg=False):
        n = 0
        color_point_to_depth = copy.deepcopy(color_point)
        color_point_to_depth[1] = 1920 - color_point_to_depth[1]
        while 1:
            self.get_the_last_depth()
            self.get_the_last_color()
            # self.depth = cv.medianBlur(image_depth_all, 5)
            if not if_call_flg:
                self._kinect._mapper.MapColorFrameToDepthSpace(
                    ctypes.c_uint(512 * 424), self._kinect._depth_frame_data, ctypes.c_uint(1920 * 1080), self.csp)
            if math.isinf(float(self.csp[color_point_to_depth[0]*1920+color_point_to_depth[1]-1].y)) or np.isnan(self.csp[color_point_to_depth[0]*1920+color_point_to_depth[1]-1].y):
                n += 1
                if n >= 50000:
                    print('彩色映射深度,無效的點')
                    depth_point = [0, 0]
                    break
            else:
                self.cor = self.csp[color_point_to_depth[0]*1920+color_point_to_depth[1]-1].y
                try:
                    depth_point = [np.int0(self.csp[color_point_to_depth[0]*1920+color_point_to_depth[1]-1].y),
                                   np.int0(self.csp[color_point_to_depth[0]*1920+color_point_to_depth[1]-1].x)]
                except OverflowError as e:
                    print('彩色映射深度,無效的點')
                    depth_point = [0, 0]
                break
        depth_point[1] = 512-depth_point[1]
        return depth_point

        # depth_points = [self._kinect._mapper.MapColorPointToDepthSpace(_ColorSpacePoint(color_point[0],color_point[1]),self.color_frame[depth_point]))
        #                 for depth_point in depth_points]
        # return color_points

    #獲得最新的彩色和深度圖像以及紅外圖像
    def get_the_data_of_color_depth_infrared_image(self, Infrared_threshold = 16000):
        # 訪問新的RGB幀
        time_s = time.time()
        if self.first_time:
            while 1:
                n = 0
                if self._kinect.has_new_color_frame():
                    #                 # 獲得的圖像數(shù)據(jù)是二維的,需要轉(zhuǎn)換為需要的格式
                    frame = self._kinect.get_last_color_frame()
                    # 返回的是4通道,還有一通道是沒有注冊的
                    gbra = frame.reshape([self._kinect.color_frame_desc.Height, self._kinect.color_frame_desc.Width, 4])
                    # 取出彩色圖像數(shù)據(jù)
                    # self.color = gbra[:, :, 0:3]
                    self.color = gbra[:, :, 0:3][:,::-1,:]
                    # 這是因為在python中直接復(fù)制該圖像的效率不如直接再從C++中獲取一幀來的快
                    frame = self._kinect.get_last_color_frame()
                    # 返回的是4通道,還有一通道是沒有注冊的
                    gbra = frame.reshape([self._kinect.color_frame_desc.Height, self._kinect.color_frame_desc.Width, 4])
                    # 取出彩色圖像數(shù)據(jù)
                    # self.color_draw = gbra[:, :, 0:3][:,::-1,:]
                    self.color_draw = gbra[:, :, 0:3][:,::-1,:]
                    n += 1
                # 訪問新的Depth幀
                if self._kinect.has_new_depth_frame():
                    # 獲得深度圖數(shù)據(jù)
                    frame = self._kinect.get_last_depth_frame()
                    # 轉(zhuǎn)換為圖像排列
                    image_depth_all = frame.reshape([self._kinect.depth_frame_desc.Height,
                                                     self._kinect.depth_frame_desc.Width])
                    # 轉(zhuǎn)換為(n,m,1) 形式
                    image_depth_all = image_depth_all.reshape(
                        [self._kinect.depth_frame_desc.Height, self._kinect.depth_frame_desc.Width, 1])
                    self.depth_ori = np.squeeze(image_depth_all)
                    self.depth = np.squeeze(image_depth_all)[:,::-1]

                    """————————————————(2019/5/11)——————————————————"""
                    # 獲得深度圖數(shù)據(jù)
                    frame = self._kinect.get_last_depth_frame()
                    # 轉(zhuǎn)換為圖像排列
                    depth_all_draw = frame.reshape([self._kinect.depth_frame_desc.Height,
                                                     self._kinect.depth_frame_desc.Width])
                    # 轉(zhuǎn)換為(n,m,1) 形式
                    depth_all_draw = depth_all_draw.reshape(
                        [self._kinect.depth_frame_desc.Height, self._kinect.depth_frame_desc.Width, 1])
                    depth_all_draw[depth_all_draw >= 1500] = 0
                    depth_all_draw[depth_all_draw <= 500] = 0
                    depth_all_draw = np.uint8(depth_all_draw / 1501 * 255)
                    self.depth_draw = depth_all_draw[:,::-1,:]
                    n += 1
                # 獲取紅外數(shù)據(jù)
                if self._kinect.has_new_infrared_frame():
                    # 獲得深度圖數(shù)據(jù)
                    frame = self._kinect.get_last_infrared_frame()
                    # 轉(zhuǎn)換為圖像排列
                    image_infrared_all = frame.reshape([self._kinect.depth_frame_desc.Height,
                                                     self._kinect.depth_frame_desc.Width])
                    # 轉(zhuǎn)換為(n,m,1) 形式
                    image_infrared_all[image_infrared_all > Infrared_threshold] = 0
                    image_infrared_all = image_infrared_all / Infrared_threshold * 255
                    self.infrared = image_infrared_all[:,::-1]
                    n += 1
                t = time.time() - time_s
                if n == 3:
                    self.first_time = False
                    break
                elif t > 5:
                    print('未獲取圖像數(shù)據(jù),請檢查Kinect2連接是否正常')
                    break
        else:
            if self._kinect.has_new_color_frame():
                #                 # 獲得的圖像數(shù)據(jù)是二維的,需要轉(zhuǎn)換為需要的格式
                frame = self._kinect.get_last_color_frame()
                # 返回的是4通道,還有一通道是沒有注冊的
                gbra = frame.reshape([self._kinect.color_frame_desc.Height, self._kinect.color_frame_desc.Width, 4])
                # 取出彩色圖像數(shù)據(jù)
                # self.color = gbra[:, :, 0:3]
                self.color = gbra[:, :, 0:3][:, ::-1, :]
                # 這是因為在python中直接復(fù)制該圖像的效率不如直接再從C++中獲取一幀來的快
                frame = self._kinect.get_last_color_frame()
                # 返回的是4通道,還有一通道是沒有注冊的
                gbra = frame.reshape([self._kinect.color_frame_desc.Height, self._kinect.color_frame_desc.Width, 4])
                # 取出彩色圖像數(shù)據(jù)
                # self.color_draw = gbra[:, :, 0:3][:,::-1,:]
                self.color_draw = gbra[:, :, 0:3][:, ::-1, :]

            # 訪問新的Depth幀
            if self._kinect.has_new_depth_frame():
                # 獲得深度圖數(shù)據(jù)
                frame = self._kinect.get_last_depth_frame()
                # 轉(zhuǎn)換為圖像排列
                image_depth_all = frame.reshape([self._kinect.depth_frame_desc.Height,
                                                 self._kinect.depth_frame_desc.Width])
                # 轉(zhuǎn)換為(n,m,1) 形式
                image_depth_all = image_depth_all.reshape(
                    [self._kinect.depth_frame_desc.Height, self._kinect.depth_frame_desc.Width, 1])
                self.depth_ori = np.squeeze(image_depth_all)
                self.depth = np.squeeze(image_depth_all)[:, ::-1]

                # 獲得深度圖數(shù)據(jù)
                frame = self._kinect.get_last_depth_frame()
                # 轉(zhuǎn)換為圖像排列
                depth_all_draw = frame.reshape([self._kinect.depth_frame_desc.Height,
                                                self._kinect.depth_frame_desc.Width])
                # 轉(zhuǎn)換為(n,m,1) 形式
                depth_all_draw = depth_all_draw.reshape(
                    [self._kinect.depth_frame_desc.Height, self._kinect.depth_frame_desc.Width, 1])
                depth_all_draw[depth_all_draw >= 1500] = 0
                depth_all_draw[depth_all_draw <= 500] = 0
                depth_all_draw = np.uint8(depth_all_draw / 1501 * 255)
                self.depth_draw = depth_all_draw[:, ::-1, :]

            # 獲取紅外數(shù)據(jù)
            if self._kinect.has_new_infrared_frame():
                # 獲得深度圖數(shù)據(jù)
                frame = self._kinect.get_last_infrared_frame()
                # 轉(zhuǎn)換為圖像排列
                image_infrared_all = frame.reshape([self._kinect.depth_frame_desc.Height,
                                                    self._kinect.depth_frame_desc.Width])
                # 轉(zhuǎn)換為(n,m,1) 形式
                image_infrared_all[image_infrared_all > Infrared_threshold] = 0
                image_infrared_all = image_infrared_all / Infrared_threshold * 255
                self.infrared = image_infrared_all[:, ::-1]





        return self.color, self.color_draw, self.depth, self.depth_draw, self.infrared

    #顯示各種圖像的視頻流
    def Kinect_imshow(self,type_im='rgb'):
        """
        Time :2019/9/3
        FunC:
        Input: color_data
        Return: color_data
        """
        if type_im =='all':
            pass
        elif type_im =='rgb':
            pass
        elif type_im =='depth':
            pass
        elif type_im =='grared':
            pass


if __name__ == '__main__':
    a = Kinect()
    while 1:
        t = time.time()
        #color_data = a.get_the_data_of_color_depth_infrared_image()
        color, color_draw, depth, depth_draw, infrared = a.get_the_data_of_color_depth_infrared_image()
        cv.imshow('a',color)
        cv.waitKey(1)


到了這里,關(guān)于Kinect系列1:(Windows環(huán)境配置)Python3+Pykinect2+KinectV2相機讀取彩色圖與深度圖的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 跟著李沐學(xué)AI(動手學(xué)深度學(xué)習(xí) PyTorch版)學(xué)習(xí)筆記——03安裝(環(huán)境配置d2l、pytorch)(python3.7版本+Windows+各種問題解決措施)

    跟著李沐學(xué)AI(動手學(xué)深度學(xué)習(xí) PyTorch版)學(xué)習(xí)筆記——03安裝(環(huán)境配置d2l、pytorch)(python3.7版本+Windows+各種問題解決措施)

    1.下載Miniconda下載地址 2.在安裝過程中需要勾選“Add Anaconda to the system PATH environment variable”選項 3.檢驗win+R,輸入cmd,在文本框輸入conda --version 1.點擊該鏈接+點擊jupyter記事本下載壓縮包 2.解壓該壓縮包 3.在解壓后的文件夾地址欄輸入cmd回車進入命令模式。 1.conda和pip默認使?

    2024年02月12日
    瀏覽(30)
  • 【Python】Python系列教程--Python3 環(huán)境搭建(二)

    【Python】Python系列教程--Python3 環(huán)境搭建(二)

    往期回顧: Python系列教程–Python3介紹(一) Python3 可應(yīng)用于多平臺包括 Windows、Linux 和 Mac OS X。 Unix (Solaris, Linux, FreeBSD, AIX, HP/UX, SunOS, IRIX, 等等。) Win 9x/NT/2000 Macintosh (Intel, PPC, 68K) OS/2 DOS (多個DOS版本) PalmOS Nokia 移動手機 Windows CE Acorn/RISC OS BeOS Amiga VMS/OpenVMS QNX VxWorks Psion Pyt

    2024年02月07日
    瀏覽(21)
  • Windows 環(huán)境下 Python3 離線安裝 cryptography 失敗

    Windows 環(huán)境下 Python3 離線安裝 cryptography 失敗

    發(fā)布Flask Web項目時,報錯缺少Cryptography,于是嘗試重新安裝該庫,但本機沒有網(wǎng)絡(luò),只支持手動離線安裝,嘗試了pip、setup.py兩種方式安裝,結(jié)果都報錯。。最后使用將安裝包拷貝至本機(在其他電腦上安裝的sitepackages里面的文件),重啟后發(fā)現(xiàn)可以讀取到該庫 這個報錯提示是

    2024年02月05日
    瀏覽(27)
  • Python3(一):環(huán)境配置

    Python3(一):環(huán)境配置

    因為生產(chǎn)項目需要一些監(jiān)控告警,并且要盡量在不修改項目代碼的前提下,所以選擇了Python寫一些告警腳本。之前一直做Java相關(guān)開發(fā),所以趁此機會學(xué)習(xí)一下Python,畢竟技多不壓身??。 本文主要介紹windows系統(tǒng)下Python的環(huán)境配置。 下載地址:python.org,選擇對應(yīng)的版本類型下

    2024年02月01日
    瀏覽(39)
  • Azure kinect (二)項目創(chuàng)建和環(huán)境配置

    Azure kinect (二)項目創(chuàng)建和環(huán)境配置

    在此之前,你需要安裝Microsoft Visual Studio,本人先使用的是2019版本,后轉(zhuǎn)用2022版本,如版本問題對項目創(chuàng)建和環(huán)境配置產(chǎn)生影響,歡迎咨詢。 新建一個C++空項目 創(chuàng)建完成后,將是以下界面,已經(jīng)熟悉Visual Studio的朋友們可跳過, 右鍵項目,進入屬性設(shè)置 在鏈接器 -- 輸入 —

    2024年02月10日
    瀏覽(21)
  • Python3 安裝與配置 簡單易懂 Windows版

    Python3 安裝與配置 簡單易懂 Windows版

    直奔主題,開始Python安裝配置 訪問Python官方網(wǎng)站([https://www.python.org])并導(dǎo)航到\\\"Downloads\\\"(下載)頁面。選擇適合操作系統(tǒng)的Python 3版本,點擊下載鏈接。 下載完成后,運行安裝程序。在安裝過程中,可以選擇自定義安裝選項,如更改安裝路徑或添加Python到系統(tǒng)環(huán)境變量。確保

    2024年02月12日
    瀏覽(19)
  • Mac安裝python3并配置環(huán)境變量

    Mac安裝python3并配置環(huán)境變量

    可以用 homebrew 安裝,也可以官網(wǎng)下載安裝,我這里選擇使用 homebrew 安裝,沒有裝 homebrew 的小伙伴請自行百度 我們執(zhí)行下 python3 發(fā)現(xiàn)可以識別命令了 先看下 python3 安裝路徑,因為我的 homebrew 是路徑為 /opt/homebrew 小伙伴可以自己找尋自己的 homebrew 安裝的路徑哈 然后我們找到

    2023年04月24日
    瀏覽(41)
  • Mac 安裝 Python3.10 和 配置環(huán)境

    Mac 安裝 Python3.10 和 配置環(huán)境

    一、Python的安裝 訪問官網(wǎng):https://www.python.org/ 選擇系統(tǒng)(Mac): [https://www.python.org/downloads/macos/] 3.選擇一個版本下載。我這里選擇了3.10.X 下載頁面:https://www.python.org/downloads/release/python-31011/ 4.然后安裝Python 一直點擊 下一步 輸入密碼 即可完成安裝啦。 二、環(huán)境變量配置 編輯

    2024年02月09日
    瀏覽(17)
  • Mac上配置python3的環(huán)境變量

    1.查看當(dāng)前python3的位置 我的電腦當(dāng)前地址路徑是:/usr/local/bin/python3 2.準備好環(huán)境變量的配置內(nèi)容 3.將內(nèi)容寫入到指定的文件里 輸入i,貼入上面準備好的內(nèi)容,然后esc,“:”,wq,就可以保存退出。 4.設(shè)置輸入python為默認的python3 執(zhí)行命令: source ~/.bash_profile source ~/.bash_p

    2024年02月12日
    瀏覽(24)
  • Python3 安裝、環(huán)境變量配置、PyCharm新建Python項目

    Python3 安裝、環(huán)境變量配置、PyCharm新建Python項目

    Pyhton官網(wǎng)下載最新穩(wěn)定版的安裝包: ?找到合適的版本進行下載: 如果下載較慢,此處提供一個3.10.11的穩(wěn)定版本的安裝包: 鏈接:https://pan.baidu.com/s/16GnWjkGFuSfWfaI9UVX8qA?pwd=4u5o? 提取碼:4u5o? 注意:此安裝包解壓后即可,不用安裝程序! 解壓或安裝后的目錄,可以看到對應(yīng)的

    2024年02月13日
    瀏覽(31)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包