简体   繁体   English

无法使用python 2.7和较新的pyserial 3.4设置vpython(用于python的视频)

[英]cannot setup vpython (videl for python) using python 2.7 and newer pyserial 3.4

I am trying to follow an online tutorial that is a little outdated. 我正在尝试遵循有点过时的在线教程。 But I like the instructor and how he follows his curriculum. 但是我喜欢老师,以及他如何遵循他的课程。 He is using python 2.7 in the video and an older version of pyserial (2.6 I believe) that I can no longer find a download for. 他在视频中使用的是python 2.7,并且使用的是旧版本的pyserial(我相信是2.6),我再也找不到下载了。 I went ahead and installed the latest python (3.7), along with the latest revision of pyserial (3.4). 我继续安装了最新的python(3.7),以及最新版本的pyserial(3.4)。 And both installed successfully without problems. 并且两者都安装成功,没有问题。

However the other IDE-looking program which he uses to code our scripts ("vPython or videl for python"), only supports python versions up to 2.7.9 但是他用来编写脚本的其他看起来像IDE的程序(“ vPython或videl for python”)仅支持2.7.9以下的python版本。

This made me back-trace and also install an older revision of python (2.7) in a separate directory with python 3.7 still being installed in another. 这使我回溯,并且还在单独的目录中安装了python(2.7)的旧版本,而python 3.7仍在另一个目录中。

Since the older version of pyserial is no longer available, I tried to install the newer pyserial 3.4 package using python 2.7 but every time I do it through the windows command line, it gives me an error saying "the module 'serial' is not available'. 由于旧版本的pyserial不再可用,我尝试使用python 2.7安装较新的pyserial 3.4程序包,但是每次通过Windows命令行执行此操作时,都会出现一条错误消息,指出“模块'serial'不可用” ”。

This is already after I had extracted the pyserial 3.4 package into the python 2.7 "Lib\\site-packages\\" directory. 这已经是我将pyserial 3.4软件包解压缩到python 2.7“ Lib \\ site-packages \\”目录之后的时候了。 And we can clearly see that the 'serial' folder is definitely in the 2.7 python library. 我们可以清楚地看到“ serial”文件夹肯定在2.7 python库中。

I'm wondering if it cannot install the module because of the differences in revisions or if it's because the command line terminal is defaulting to the latest version of python (3.7) automatically to execute the installation. 我想知道是否由于版本差异而无法安装模块,还是因为命令行终端默认自动使用最新版本的python(3.7)来执行安装。

If this is incompatible, maybe someone can help provide a link to the older version of pyserial or help me find another solution to this problem. 如果不兼容,也许有人可以帮助提供指向较旧版本pyserial的链接,或者帮助我找到解决此问题的另一种方法。

Edit: I found a version of pyserial 2.7 but it is for 32 bit windows and not 64. I have been sticking to versions of 64 bit for python and vpython. 编辑:我发现了pyserial 2.7的版本,但它是针对32位窗口而不是64位的。我一直坚持使用python和vpython的64位版本。

So I found an older version of pyserial 2.7 for windows 32 bit. 所以我找到了Windows 32位的pyserial 2.7的旧版本。 I'm not sure if pyserial had a 64 bit version at the time 2.7 was released because I could not find it. 我不确定pyserial在2.7发布时是否具有64位版本,因为我找不到它。 I uninstalled python 2.7 64 bit and replaced it with 32 bit, and then did the same for vpython. 我卸载了python 2.7 64位并将其替换为32位,然后对vpython进行了同样的操作。

This got the program up and running successfully and importing the serial libraries just fine. 这使程序成功启动并运行,并且可以很好地导入串行库。

The next problem was that the 32 bit vpython and 64 bit arduino's did not play nice together. 下一个问题是32位vpython和64位arduino不能一起玩。 And I could not get vpython to read serial data from arduino despite copying code verbatum and having it compile correctly. 尽管复制了代码verbatum并正确编译了它,但我无法让vpython从arduino读取串行数据。

My solution was just to use the pycharm IDE instead. 我的解决方案只是使用pycharm IDE。 It has a package installer that just downloads and installs everything for you. 它具有一个软件包安装程序,可以为您下载并安装所有内容。 Thank god too because I spent around 3 hours trying to get the packages installed manually through the command terminal but kept running into compatibility issues like outdated published files, an annoying syntax error through cmd, a "not supported on this platform" error (despite pip and everything being 100% kosher) and not having microsoft C++ version 14 AND HAVING NO IDEA THIS RESOURCE WAS MISSING. 还要感谢上帝,因为我花了大约3个小时试图通过命令终端手动安装软件包,但一直遇到兼容性问题,例如过时的发布文件,通过cmd引起的令人讨厌的语法错误,“此平台不支持”错误(尽管pip并且所有内容均为100%洁净),并且没有Microsoft C ++版本14,并且没有此资源的缺失。

But pycharm solved all of that. pycharm解决了所有这些问题。 Sorry for the somewhat salty response. 抱歉,回复有点咸。 I just hope it saves someone else's time. 我只是希望它可以节省别人的时间。 Pretty upset this wasn't suggested on any of the official websites anywhere. 在任何地方的任何官方网站上都没有建议这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM