我的磁盘内存有限,想知道如何在 python 2.7 下卸载/删除 spacy 2.xx 的文件(我使用 python3 并认为我已经为它正确安装了 spacy)。同样适用于我的 python3 安装中的默认模型。这是我的终端会话:
gw-mac-pro:~ gr$ pip install -U spacy
Collecting spacy
Downloading https://files.pythonhosted.org/packages/f8/db/490f0552f0f39eb3b75119
...
Linking successful
/usr/local/lib/python2.7/site-packages/en_core_web_sm -->
/usr/local/lib/python2.7/site-packages/spacy/data/en
You can now load the model via spacy.load('en')
gw-mac-pro:~ gr$ python -m spacy download en
Run Code Online (Sandbox Code Playgroud)
是否有卸载脚本(我找不到)?如果没有,我可以删除这些目录吗?我需要在别处删除文件吗?
显然,新来的空间。谢谢你的帮助!
补充:我应该提到我在 Mac OS 上(对不起,macOS)。我刚刚找到了一个命令来显示有关我的 spacy 安装的信息。这是它为 python 2.7 返回的内容
gw-mac-pro:~ gr$ python -m spacy info
Info about spaCy
Python version 2.7.15
Platform Darwin-15.6.0-x86_64-i386-64bit
spaCy version 2.0.16
Location /usr/local/lib/python2.7/site-packages/spacy
Models en
Run Code Online (Sandbox Code Playgroud) 我已经攻击了我的bash提示符(理论上)告诉我我目前正在使用什么git分支.但是输出表明出现了问题:
22:07 (seesaw|REBASE-i) infwb $git branch
* master
wkg
Run Code Online (Sandbox Code Playgroud)
这是我的.bash_profile文件中的相关代码(我将在这个问题的最后添加一个更大的部分):
PS1="$GRAY\$(date +%H:%M)\$(__git_ps1) $GREEN\W$YELLOW \$"
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,$(__git_ps1)
回报率(seesaw|REBASE-i)
,即使我不再有一个跷跷板分支!(我确实有一个,它与我在github上的远程跷跷板分支有一个rebase问题.我想,我解决了这个问题,并git branch -r seesaw
成功删除了本地副本.)
我很确定这(seesaw|REBASE-i)
告诉我有什么不对劲,但我不知道它是什么.
感谢您提出的任何建议.(大块的.bash_profile如下)
-------from .bash_profile ---------
## ----- from http://en.newinstance.it/2010/05/23/git-autocompletion-and-enhanced-bash-prompt/
# Set git autocompletion and PS1 integration
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
. /usr/local/git/contrib/completion/git-completion.bash
fi
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
## ----- end
GRAY="\[\033[1;30m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
PS1="$GRAY\$(date +%H:%M)\$(__git_ps1) $GREEN\W$YELLOW \$"
----------------
Run Code Online (Sandbox Code Playgroud)
附录
@cdhowie和@manojlds,我对你的git知识印象深刻!
git rebase --abort
导致信息更改为(seesaw)
.不幸的是,我无法在硬盘上找到rebase-merge …
我正在将工作Clojure代码(在Leiningen项目中)从1.2移植到1.3并且存在问题.除了代码本身不再有效之外,我收到了许多类似这样的警告消息:
Warning: *tooltip-width* not declared dynamic and thus is not dynamically rebindable,
but its name suggests otherwise. Please either indicate ^:dynamic *tooltip-width*
or change the name.
Run Code Online (Sandbox Code Playgroud)
这种情况正在发生,即使我已经做了正如我正在用来保持状态的vars的正确修改.例如,对于上面的错误,代码已包含以下内容:
(def ^:dyanamic *tooltip-width* (* 1.8 *slip-width*))
Run Code Online (Sandbox Code Playgroud)
我在两个地方得到这些错误:首先,从命令行,执行的结果lein swank
; 第二,来自Emacs REPL,在core.clj
使用后编译我的文件C-c C-w
.
要绝对完整,这是我的project.clj
文件:
(defproject infwb "1.0.0-SNAPSHOT"
:description "an evolving, experimental workspace for manipulating infocards"
:main infwb.core
:dependencies [[org.clojure/clojure "1.3"]
[seesaw "1.2.1"]
[org.clojars.gw666/sxqj "beta2"]
[org.clojars.gw666/piccolo2dcore "1.3"]
[org.clojars.gw666/piccolo2dextras "1.3"]
[com.miglayout/miglayout "3.7.4"]
]
:dev-dependencies [[swank-clojure "1.3.2"]
[org.clojars.weavejester/autodoc "0.9.0"]]
:autodoc …
Run Code Online (Sandbox Code Playgroud) 在使用Leiningen时,我遇到了以下突然错误:
线程"main"中的异常java.lang.NoSuchMethodError:org.apache.tools.ant.util.FileUtils.getFileUtils()Lorg/apache/tools/ant/util/FileUtils; (core.clj:1)
我在https://github.com/technomancy/leiningen/issues/194找到了以下答案:
if ant version 1.6.1 is included in a project, lein fails. Autodoc "0.7.1" includes ant version 1.6.1.
a work around is to exclude ant.1.6.1 in the project.clj. <--- *1*
But a better solution is changing the order of lein classpath.
from bin/lein <--- *2*
CLASSPATH="$CLASSPATH:$LEIN_LIBS:$LEIN_DIR/src:$LEIN_DIR/classes:$LEIN_DIR/resources:$LEIN_JAR"
**changes to : **
CLASSPATH="$LEIN_LIBS:$LEIN_DIR/src:$LEIN_DIR/classes:$LEIN_DIR/resources:$LEIN_JAR;$CLASSPATH"
Run Code Online (Sandbox Code Playgroud)
我读的Leiningen教程https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md,并在样本project.clj文件https://github.com/technomancy/leiningen/blob/stable /sample.project.clj,但我仍然有以下问题:
1)在上面标记为1的行上,我无法告诉如何排除特定版本的jar文件.
2)在2,上面,究竟是什么bin/lein
?我的Leiningen项目没有bin目录,Leiningen本身就是一个脚本,所以那里没有bin目录?
非常感谢您的帮助.
附录8/6/11:对于Autodoc的具体问题,我找到了一个Autodoc的分支,为我解决了这个问题.只需将"[org.clojars.weavejester/autodoc"0.9.0"]"添加到project.clj> defproject> :dev-dependencies
子句即可.然后,从命令行(目录等于你的leiningen项目的根目录),执行'lein autodoc',等待一段时间.
我已经被困在一件我知道我以前曾经做过的事情上好几天了。我可能错过了一些明显的东西。任何帮助,将不胜感激。
在我的 Clojure 程序中,我想访问最初用 Java 编写的类中的方法。让我们使用一个具体的例子:org.infoml.jaxb.ObjectFactory。这些类位于 .jar 文件 ( infoml-classes-1.0.jar
) 中,该文件是可双击的 Java 应用程序。如果打开 jar 文件,您会看到 Java 类包的顶级部分的文件夹:
macscooter:infoml-classes-1.0 folder gw$ find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
.
|____META-INF
| |____MANIFEST.MF
|____org
| |____infoml
| | |____infocardOrganizer <<<<<< Java application's classes
| | | |____AFileFilter.class
| ... many classes omitted here
| | | |____UniqueContentListener.class
| | | |____UniqueContentModel.class
| | |____jaxb
| | | |____AgentContainerLocationType.class
| | | |____AgentType.class
| ... many classes omitted here
| …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Clojure doc
函数获取文档,但无法从REPL中识别它(我正在使用Emacs和SLIME).以下序列描述了正在发生的事情(每行后紧跟错误信息):
gaidica.core> (doc first)
; Evaluation aborted.
Unable to resolve symbol: doc in this context
[Thrown class java.lang.Exception]
gaidica.core> (clojure.core/doc first)
; Evaluation aborted.
No such var: clojure.core/doc
[Thrown class java.lang.Exception]
user> (clojure.core/doc first)
; Evaluation aborted.
No such var: clojure.core/doc
[Thrown class java.lang.Exception]
user> (doc first)
-------------------------
clojure.core/first
([coll])
Returns the first item in the collection. Calls seq on its
argument. If coll is nil, returns nil.
nil
user>
Run Code Online (Sandbox Code Playgroud)
我如何引用该doc
函数并将其识别为函数,而不是变量?
问题发布后9小时,2011年6月22日,ADDENDUM
@kotarak发表了最相关的评论:"注意,clojure.core/doc是1.2及更早版本.clojure.repl/doc是1.3及更高版本." 果然,以下工作:
user> (clojure.repl/doc …
Run Code Online (Sandbox Code Playgroud) 我在做一些我认为简单的事情时遇到了一件莫名其妙的事情.我的classpath上有一个JAR文件.我在Emacs中,使用SLIME REPL,我正在尝试访问Java类实例的静态字段(JAR中的一个).
这是我的班级:
public class MainFrame extends JFrame implements WindowListener,
TreeSelectionListener {
JPanel panel;
InfocardWindow infoWindow;
InfocardBuilder infocardBuilder;
Main infomlFile;
static NotecardModel setupModel;
...
Run Code Online (Sandbox Code Playgroud)
当我尝试:
infwb.cardmaker> (import 'javax.swing.JFrame)
javax.swing.JFrame
infwb.cardmaker> (import 'org.infoml.infocardOrganizer.MainFrame)
org.infoml.infocardOrganizer.MainFrame
infwb.cardmaker> MainFrame/setupModel
; Evaluation aborted.
Run Code Online (Sandbox Code Playgroud)
错误消息是:
Unable to find static field: setupModel in class org.infoml.infocardOrganizer.MainFrame
[Thrown class java.lang.Exception]
Run Code Online (Sandbox Code Playgroud)
我尝试切换到一个更简单的问题:访问非静态字段.我在一个内部做了let
,以消除从REPL执行此操作可能是问题的根源的可能性:
infwb.cardmaker> (let [mainFr (MainFrame.)]
(println (.panel mainFr)))
; Evaluation aborted.
Run Code Online (Sandbox Code Playgroud)
错误消息是:
No matching field found: panel for class org.infoml.infocardOrganizer.MainFrame
[Thrown class java.lang.IllegalArgumentException]
Run Code Online (Sandbox Code Playgroud)
当取代(.panel mainFr)
和 …
在调试一个更大的函数的过程中,我创建了一个更简单的函数来测试错误的位置:
(defn foo [a-val p1 p2 & rest]
(loop [curr-preds (cons p1 (cons p2 rest))]
(let [first-pred (first curr-preds)
first-bool (first-pred a-val)
second-bool ((second curr-preds) a-val)
third-bool ((last curr-preds) a-val)]
(println "\n\nLogical values: " first-bool second-bool third-bool)
(println "Is it a seq?" (seq? curr-preds))
(if (empty? curr-preds)
first-bool
#_(recur (rest curr-preds))
))))
Run Code Online (Sandbox Code Playgroud)
p1,p2和rest中的函数集合都是谓词(例如,奇数?).我写这篇文章是为了期望它总是被调用3个谓词.
当我取出#_
倒数第二行时,我收到以下错误:
java.lang.ClassCastException: clojure.lang.ArraySeq cannot be cast to clojure.lang.IFn
/Users/gr/temp/LTtemp1.clj:166 user/foo
RestFn.java:467 clojure.lang.RestFn.invoke
Run Code Online (Sandbox Code Playgroud)
通过println
陈述,我发现:
seq
如预期的那样,curr-preds 包含3个谓词
调用每个pred会a-val
返回预期的结果
curr-preds
实际上是一个 seq
我的问题: …