如何解决网纹配置/安装问题[R]
我正在尝试使用 import discord
import os
from discord.ext import commands
from keep_alive import keep_alive
import random
from discord import Member,Embed
from discord.ext.commands import BucketType,cooldown
from discord.ext.commands import errors
import asyncio
@client.command()
@cooldown(4,11,BucketType.user)
async def test(ctx,args,*,question):
response = ""
for arg in args:
response = response + " " + arg
embed=discord.Embed(title="\"" + response + "\"",colour=ctx.author.colour)
embed.set_author(name=ctx.author.display_name,icon_url=ctx.author.avatar_url)
somegifs = random.choice(gifs)
embed.set_image(url=somegifs)
embed.set_footer(text="Test embed")
await ctx.send(embed=embed)
@test.error
async def test_error(ctx,error):
if isinstance(error,errors.MissingRequiredArgument):
embed2 = discord.Embed(title="you have to type something in",colour=ctx.author.colour)
embed2.set_author(name=ctx.author.display_name,icon_url=ctx.author.avatar_url)
embed2.set_footer(text="Test embed")
await ctx.send(embed=embed2)
else: raise(error)
在 R 中集成 Python 模块,尽管遵循 tutorial(miniconda 已安装),但似乎没有任何工作正常.我尝试使用 default 方式并指定 conda 和 虚拟环境:
reticulate
知道我遗漏了什么吗?谢谢。
解决方法
我认为问题在于 py_module_available
使用模块名称,而不是 pypi 上的包名称。
你能不能试试:
> py_module_available("igraph")
,
我忘了提及我正在研究 Windows SO,但我想这些信息没有添加任何相关内容。
最后(并考虑到@reverse_engineer 的回答)我解决了它,只需添加 pip = T
,与配置虚拟环境无关:
> library(reticulate)
> py_install("python-igraph",pip = T)
> import("igraph")
# Module(igraph)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。