如何使用 easy_install 安装 pysvg?

发布于 2024-10-26 20:20:26 字数 1035 浏览 9 评论 0原文

我是一名铁杆C程序员,我想学习Python。我正在尝试编写一个脚本来生成 SVG 文件。如果我不能让它工作,那么我就会杀死几只小猫并编写 C 程序来执行此任务。

我想使用 pysvg 库。事实上,我并没有与那个特定的图书馆结婚。 我应该使用更好的 SVG 生成器(确实有更好的文档记录)库吗? 您使用哪个库来生成 SVG?我正在从头开始创建简单的 SVG(框和线)。

我尝试下载该软件包并运行 python install.py install 但我真的不想给它 root 访问权限。

然后我心软了,决定尝试 sudo easy_install pysvg ,但它不起作用:

rascher@coltrane:~$ sudo easy_install pysvg
Searching for pysvg
Reading http://pypi.python.org/simple/pysvg/
Reading http://codeboje.de/pysvg/
No local packages or download links found for pysvg
error: Could not find suitable distribution for Requirement.parse('pysvg')

rascher@coltrane:~$ sudo easy_install pysvg==0.2.1
Searching for pysvg==0.2.1
Reading http://pypi.python.org/simple/pysvg/
Reading http://codeboje.de/pysvg/
No local packages or download links found for pysvg==0.2.1
error: Could not find suitable distribution for Requirement.parse('pysvg==0.2.1')

我做错了什么?如何安装这个库?

I am a hardcore C programmer and I want to learn python. I am trying to write a script to generate SVG files. If I can't get this to work then I will just kill a few kittens and write C program to perform this task.

I want to use the pysvg library. Actually, I'm not married to that particular library. Is there a better SVG-generator (better-documented, really) lib I should use? Which library do you use for generating SVGs? I am creating simple SVGs (boxes and lines) from scratch.

I tried downloading the package and running python install.py install but I didn't really want to give it root access.

Then I relented and decided to try sudo easy_install pysvg and it just won't work:

rascher@coltrane:~$ sudo easy_install pysvg
Searching for pysvg
Reading http://pypi.python.org/simple/pysvg/
Reading http://codeboje.de/pysvg/
No local packages or download links found for pysvg
error: Could not find suitable distribution for Requirement.parse('pysvg')

rascher@coltrane:~$ sudo easy_install pysvg==0.2.1
Searching for pysvg==0.2.1
Reading http://pypi.python.org/simple/pysvg/
Reading http://codeboje.de/pysvg/
No local packages or download links found for pysvg==0.2.1
error: Could not find suitable distribution for Requirement.parse('pysvg==0.2.1')

What am I doing wrong? How do I install this library?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

所谓喜欢 2024-11-02 20:20:26

帮我个忙,用 easy_install 再次尝试一下。它现在应该可以工作了,因为我将主要的二进制 zip 文件上传到了 PyPI。
我必须承认我忽略了 pysvg 的安装过程很多,因为:
-大多数用户(到目前为止)更喜欢直接从存储库获取源代码
-我从来不需要自己安装它;-)

但是这些都不是很好的借口。

最好的,
克里姆

do me the favor and try it once more with easy_install. It should work now, as i uploaded the main binary zip file to PyPI.
I must admit I neglected the installation procedure of pysvg quite a lot because:
-Most users (so far) preferred to fetch the sources directly from the repository
-I never have to install it myself ;-)

But these are not really good excuses.

Best,
Kerim

彻夜缠绵 2024-11-02 20:20:26

看起来不像是在 pypi 中。您应该向维护者发送电子邮件并建议将其包含在内。

至于从源代码安装它,如果您的 python 安装由 root 用户拥有(确实如此),那么您需要在运行安装命令时使用 sudo 。如果您担心它会做什么,请打开脚本并查看。

Doesn't look like it's in pypi. You should email the maintainer and recommend it get included.

As for installing it from source, if your python install is owned by root (it is) then you need to use sudo when running the install command. If you're worried about what it might doing, open up the script and take a look.

白龙吟 2024-11-02 20:20:26
bin/easy_install http://pysvg.googlecode.com/files/pysvg-0.2.1.zip

...并要求维护者正确更新他的 PyPI 包元数据或提供PyPI 上的副本。不将包上传到 PyPI,仅使用不正确的元数据进行注册,这只是一些维护者的赤裸裸的 * 态度。

bin/easy_install http://pysvg.googlecode.com/files/pysvg-0.2.1.zip

...and ask the maintainer to update his PyPI package metadata properly or to provide a copy on PyPI. Not uploading packages to PyPI and only having a registration with improper metadata is just bare * attitude of some maintainers.

氛圍 2024-11-02 20:20:26

我应该使用更好的 SVG 生成器(确实有更好的文档)库吗?

实际上有很多

我正在从头开始创建简单的 SVG(框和线)

然后尝试 svgwrite 。这是一个例子:

import svgwrite
dwg = svgwrite.Drawing('test.svg', profile='tiny')
dwg.add(dwg.line((0, 0), (10, 0), stroke=svgwrite.rgb(10, 10, 16, '%')))
dwg.add(dwg.text('Test', insert=(0, 0.2), fill='red'))
dwg.save()

Is there a better SVG-generator (better-documented, really) lib I should use?

There are a bunch of them actually.

I am creating simple SVGs (boxes and lines) from scratch

Then give svgwrite a try. Here's an example:

import svgwrite
dwg = svgwrite.Drawing('test.svg', profile='tiny')
dwg.add(dwg.line((0, 0), (10, 0), stroke=svgwrite.rgb(10, 10, 16, '%')))
dwg.add(dwg.text('Test', insert=(0, 0.2), fill='red'))
dwg.save()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文