简体   繁体   English

无法安装Python版TextBlob

[英]Trouble installing TextBlob for Python

I am new to programming, and I'm trying to install the TextBlob library for Python to help me do some stuff. 我是编程新手,我正在尝试安装适用于Python的TextBlob库以帮助我做一些事情。 Sadly, I'm having trouble installing TextBlob, let alone use it. 不幸的是,我在安装TextBlob时遇到问题,更不用说使用它了。 I am using Windows, which seems to make things more difficult. 我正在使用Windows,这似乎使事情变得更加困难。 I wish I could just run the Linux commands or whatever they are that everybody uses. 我希望我可以运行Linux命令或每个人使用的命令。 Anyway 无论如何

Here is what I have done so far: 到目前为止,这是我所做的:

  1. Forked the Textblob program from here. 此处派生了Textblob程序
  2. Copied the entire repository to my desktop, and opened the folder up. 将整个存储库复制到我的桌面,然后打开文件夹。
  3. Using Command Prompt, ran "Python C:\\Users...\\setup.py install" 使用命令提示符运行“ Python C:\\ Users ... \\ setup.py install”

Command Prompt spits back- 命令提示符后退-

Traceback (most recent call last):
  File "C:\Users\Sam\Desktop\TextBlob\setup.py", line 56, in <module>
    __version__ = find_version("textblob/__init__.py")
  File "C:\Users\Sam\Desktop\TextBlob\setup.py", line 45, in find_version
    with open(fname, 'r') as fp:
IOError: [Errno 2] No such file or directory: 'textblob/__init__.py'

And I have no idea what to do or how to fix this. 而且我不知道该怎么办或如何解决此问题。 Shouldn't this fresh download of TextBlob have the ability to install? 全新下载的TextBlob是否应该具有安装功能? What am I messing up? 我搞砸了吗?

You are expected to be in the directory when installing. 安装时应将您放在目录中。 Try: 尝试:

cd C:\Users\Sam\Desktop\TextBlob
python setup.py install

BTW try to get out of the habit of saving things to the desktop. BTW尝试摆脱将内容保存到桌面的习惯。 You should only have short cuts on there especially on corporate machines as they often save the desktop on shutdown to the network and load it on startup - this slows things down a lot when there are files and directories on there. 应该在这里有捷径,尤其是在公司机器上,因为它们通常在关机时将桌面保存到网络上,并在启动时加载它-当那里有文件和目录时,这会大大降低速度。

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

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