在导入guesslang
软件包时,我发现关于ContextualVersionConflict
软件包的html5lib
错误。
ContextualVersionConflict: (html5lib 1.0.1 (/Users/user_name/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages), Requirement.parse('html5lib==0.9999999'), {'tensorboard'})
我重新安装了html5lib
版本的1.0.1
,并再次安装了版本0.9999999
(七个9s),但是两次尝试的结果是相同的。
这是我运行的代码。
from guesslang import Guess
code_snippet = "import numpy as np"
print(Guess().language_name(code_snippet))
整个错误消息。
---------------------------------------------------------------------------
ContextualVersionConflict Traceback (most recent call last)
<ipython-input-113-766936e416d4> in <module>
----> 1 from guesslang import Guess
2 code_snippet = "import numpy as np"
3 print(Guess().language_name(code_snippet))
~/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/guesslang/__init__.py in <module>
6
7 from guesslang.config import config_logging # noqa: F401
----> 8 from guesslang.guesser import Guess # noqa: F401
9 from guesslang.utils import GuesslangError # noqa: F401
10
~/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/guesslang/guesser.py in <module>
11
12 from guesslang.config import model_info, config_dict
---> 13 from guesslang.extractor import extract, CONTENT_SIZE
14 from guesslang.utils import (
15 search_files, extract_from_files, safe_read_file, GuesslangError, DataSet)
~/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/guesslang/extractor.py in <module>
14
15 SPECIAL_KEYWORDS = {'num': '<number>', 'var': '<variable>'}
---> 16 KEYWORDS = config_dict('keywords.json')
17
18 SEPARATOR = re.compile(r'(\W)')
~/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/guesslang/config.py in config_dict(name)
73 def config_dict(name: str) -> Dict[str, Any]:
74 """Load a JSON configuration dict from Guesslang config directory.
---> 75
76 :param name: the JSON file name.
77 :return: configuration
~/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/pkg_resources/__init__.py in resource_string(self, package_or_requirement, resource_name)
1154 def resource_string(self, package_or_requirement, resource_name):
1155 """Return specified resource as a string"""
-> 1156 return get_provider(package_or_requirement).get_resource_string(
1157 self, resource_name
1158 )
~/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/pkg_resources/__init__.py in get_provider(moduleOrReq)
355 """Return an IResourceProvider for the named module or requirement"""
356 if isinstance(moduleOrReq, Requirement):
--> 357 return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
358 try:
359 module = sys.modules[moduleOrReq]
~/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/pkg_resources/__init__.py in require(self, *requirements)
898 included, even if they were already activated in this working set.
899 """
--> 900 needed = self.resolve(parse_requirements(requirements))
901
902 for dist in needed:
~/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/pkg_resources/__init__.py in resolve(self, requirements, env, installer, replace_conflicting, extras)
789 # Oops, the "best" so far conflicts with a dependency
790 dependent_req = required_by[req]
--> 791 raise VersionConflict(dist, req).with_context(dependent_req)
792
793 # push the new requirements onto the stack
ContextualVersionConflict: (html5lib 1.0.1 (/Users/hidenori/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages), Requirement.parse('html5lib==0.9999999'), {'tensorboard'})
pip list
的结果。
Package Version
--------------------------------------- -------------
absl-py 0.9.0
alabaster 0.7.12
algorithmia 1.2.1
algorithmia-api-client 1.1.0
anaconda-client 1.7.2
anaconda-navigator 1.9.7
anaconda-project 0.8.2
applaunchservices 0.2.1
appnope 0.1.0
appscript 1.0.1
argh 0.26.2
asn1crypto 0.24.0
astor 0.8.1
astroid 2.2.5
astropy 3.1.2
atomicwrites 1.3.0
attrs 19.1.0
autopep8 1.4.4
Babel 2.6.0
backcall 0.1.0
backports.os 0.1.1
backports.shutil-get-terminal-size 1.0.0
beautifulsoup4 4.7.1
bitarray 0.9.0
bkcharts 0.2
blaze 0.11.3
bleach 1.5.0
bokeh 1.1.0
boto 2.49.0
boto3 1.9.199
botocore 1.12.199
Bottleneck 1.2.1
certifi 2019.3.9
cffi 1.12.3
chardet 3.0.4
chromedriver-binary 74.0.3729.6.0
Click 7.0
cloudpickle 0.8.1
clyent 1.2.2
colorama 0.4.1
conda 4.6.14
conda-build 3.17.8
conda-verify 3.1.1
contextlib2 0.5.5
coverage 5.0.1
cryptography 2.6.1
cycler 0.10.0
Cython 0.29.7
cytoolz 0.9.0.1
dask 1.2.0
datashape 0.5.4
decorator 4.4.0
defusedxml 0.6.0
diff-match-patch 20181111
distributed 1.27.1
docutils 0.14
dominate 2.3.1
dryscrape 1.0
entrypoints 0.3
enum34 1.1.6
et-xmlfile 1.0.1
fastcache 1.0.2
filelock 3.0.10
flake8 3.7.9
Flask 1.0.2
Flask-Bootstrap 3.3.7.1
Flask-Cors 3.0.7
future 0.17.1
gast 0.3.2
gensim 3.8.0
gevent 1.4.0
gitdb2 2.0.5
GitPython 3.0.2
glob2 0.6
gmpy2 2.0.8
greenlet 0.4.15
grpcio 1.26.0
guesslang 0.9.4
h5py 2.8.0
heapdict 1.0.0
helpdev 0.6.10
html5lib 0.9999999
idna 2.8
imageio 2.5.0
imagesize 1.1.0
importlib-metadata 1.3.0
imutils 0.5.2
intervaltree 3.0.2
ipykernel 5.1.0
ipython 7.5.0
ipython-genutils 0.2.0
ipywidgets 7.4.2
iso8601 0.1.12
isort 4.3.17
itsdangerous 1.1.0
jdcal 1.4.1
jedi 0.14.1
Jinja2 2.10.1
jmespath 0.9.4
jsonschema 3.0.1
jupyter 1.0.0
jupyter-client 5.2.4
jupyter-console 6.0.0
jupyter-core 4.4.0
jupyterlab 0.35.5
jupyterlab-launcher 0.13.1
jupyterlab-server 0.2.0
jupyterthemes 0.20.0
keyring 18.0.0
kiwisolver 1.1.0
langdetect 1.0.7
lazy-object-proxy 1.3.1
lesscpy 0.13.0
libarchive-c 2.8
lief 0.9.0
ll 1.0
llvmlite 0.28.0
locket 0.2.0
lxml 4.3.3
Markdown 3.1.1
MarkupSafe 1.1.1
matplotlib 3.0.3
mccabe 0.6.1
mecab-python3 0.996.2
mistune 0.8.4
mock 3.0.5
more-itertools 8.0.2
mpmath 1.1.0
msgpack 0.6.1
multipledispatch 0.6.0
navigator-updater 0.2.1
nbconvert 5.5.0
nbformat 4.4.0
networkx 2.3
nltk 3.4.1
nose 1.3.7
notebook 5.7.8
numba 0.43.1
numexpr 2.6.9
numpy 1.16.3
numpydoc 0.9.1
odo 0.5.1
olefile 0.46
openpyxl 2.6.2
packaging 19.0
pandas 0.24.2
pandocfilters 1.4.2
parso 0.5.2
partd 0.3.10
path.py 12.0.1
pathlib2 2.3.3
pathtools 0.1.2
patsy 0.5.1
pdf2image 1.5.1
PeakUtils 1.1.1
pep8 1.7.1
pexpect 4.7.0
pickleshare 0.7.5
Pillow 6.0.0
pip 19.1
pip-conflict-checker 0.6.0
pkginfo 1.5.0.1
pluggy 0.9.0
ply 3.11
prometheus-client 0.6.0
prompt-toolkit 2.0.9
protobuf 3.11.2
psutil 5.6.2
ptyprocess 0.6.0
py 1.8.0
pycodestyle 2.5.0
pycosat 0.6.3
pycparser 2.19
pycrypto 2.6.1
pycurl 7.43.0.2
pydocstyle 5.0.1
pydot 1.2.4
pyflakes 2.1.1
Pygments 2.3.1
pylint 2.3.1
pymongo 3.9.0
Pympler 0.8
pyobjc 6.1
pyobjc-core 6.1
pyobjc-framework-Accounts 6.1
pyobjc-framework-AddressBook 6.1
pyobjc-framework-AdSupport 6.1
pyobjc-framework-AppleScriptKit 6.1
pyobjc-framework-AppleScriptObjC 6.1
pyobjc-framework-ApplicationServices 6.1
pyobjc-framework-AuthenticationServices 6.1
pyobjc-framework-Automator 6.1
pyobjc-framework-AVFoundation 6.1
pyobjc-framework-AVKit 6.1
pyobjc-framework-BusinessChat 6.1
pyobjc-framework-CalendarStore 6.1
pyobjc-framework-CFNetwork 6.1
pyobjc-framework-CloudKit 6.1
pyobjc-framework-Cocoa 6.1
pyobjc-framework-Collaboration 6.1
pyobjc-framework-ColorSync 6.1
pyobjc-framework-Contacts 6.1
pyobjc-framework-ContactsUI 6.1
pyobjc-framework-CoreAudio 6.1
pyobjc-framework-CoreAudioKit 6.1
pyobjc-framework-CoreBluetooth 6.1
pyobjc-framework-CoreData 6.1
pyobjc-framework-CoreHaptics 6.1
pyobjc-framework-CoreLocation 6.1
pyobjc-framework-CoreMedia 6.1
pyobjc-framework-CoreMediaIO 6.1
pyobjc-framework-CoreML 6.1
pyobjc-framework-CoreMotion 6.1
pyobjc-framework-CoreServices 6.1
pyobjc-framework-CoreSpotlight 6.1
pyobjc-framework-CoreText 6.1
pyobjc-framework-CoreWLAN 6.1
pyobjc-framework-CryptoTokenKit 6.1
pyobjc-framework-DeviceCheck 6.1
pyobjc-framework-DictionaryServices 6.1
pyobjc-framework-DiscRecording 6.1
pyobjc-framework-DiscRecordingUI 6.1
pyobjc-framework-DiskArbitration 6.1
pyobjc-framework-DVDPlayback 6.1
pyobjc-framework-EventKit 6.1
pyobjc-framework-ExceptionHandling 6.1
pyobjc-framework-ExecutionPolicy 6.1
pyobjc-framework-ExternalAccessory 6.1
pyobjc-framework-FileProvider 6.1
pyobjc-framework-FileProviderUI 6.1
pyobjc-framework-FinderSync 6.1
pyobjc-framework-FSEvents 6.1
pyobjc-framework-GameCenter 6.1
pyobjc-framework-GameController 6.1
pyobjc-framework-GameKit 6.1
pyobjc-framework-GameplayKit 6.1
pyobjc-framework-ImageCaptureCore 6.1
pyobjc-framework-IMServicePlugIn 6.1
pyobjc-framework-InputMethodKit 6.1
pyobjc-framework-InstallerPlugins 6.1
pyobjc-framework-InstantMessage 6.1
pyobjc-framework-Intents 6.1
pyobjc-framework-IOSurface 6.1
pyobjc-framework-iTunesLibrary 6.1
pyobjc-framework-LatentSemanticMapping 6.1
pyobjc-framework-LaunchServices 6.1
pyobjc-framework-libdispatch 6.1
pyobjc-framework-LinkPresentation 6.1
pyobjc-framework-LocalAuthentication 6.1
pyobjc-framework-MapKit 6.1
pyobjc-framework-MediaAccessibility 6.1
pyobjc-framework-MediaLibrary 6.1
pyobjc-framework-MediaPlayer 6.1
pyobjc-framework-MediaToolbox 6.1
pyobjc-framework-MetalKit 6.1
pyobjc-framework-ModelIO 6.1
pyobjc-framework-MultipeerConnectivity 6.1
pyobjc-framework-NaturalLanguage 6.1
pyobjc-framework-NetFS 6.1
pyobjc-framework-Network 6.1
pyobjc-framework-NetworkExtension 6.1
pyobjc-framework-NotificationCenter 6.1
pyobjc-framework-OpenDirectory 6.1
pyobjc-framework-OSAKit 6.1
pyobjc-framework-OSLog 6.1
pyobjc-framework-PencilKit 6.1
pyobjc-framework-Photos 6.1
pyobjc-framework-PhotosUI 6.1
pyobjc-framework-PreferencePanes 6.1
pyobjc-framework-PubSub 6.1
pyobjc-framework-PushKit 6.1
pyobjc-framework-Quartz 6.1
pyobjc-framework-QuickLookThumbnailing 6.1
pyobjc-framework-SafariServices 6.1
pyobjc-framework-SceneKit 6.1
pyobjc-framework-ScreenSaver 6.1
pyobjc-framework-ScriptingBridge 6.1
pyobjc-framework-SearchKit 6.1
pyobjc-framework-Security 6.1
pyobjc-framework-SecurityFoundation 6.1
pyobjc-framework-SecurityInterface 6.1
pyobjc-framework-ServiceManagement 6.1
pyobjc-framework-Social 6.1
pyobjc-framework-SoundAnalysis 6.1
pyobjc-framework-Speech 6.1
pyobjc-framework-SpriteKit 6.1
pyobjc-framework-StoreKit 6.1
pyobjc-framework-SyncServices 6.1
pyobjc-framework-SystemConfiguration 6.1
pyobjc-framework-SystemExtensions 6.1
pyobjc-framework-UserNotifications 6.1
pyobjc-framework-VideoSubscriberAccount 6.1
pyobjc-framework-VideoToolbox 6.1
pyobjc-framework-Vision 6.1
pyobjc-framework-WebKit 6.1
pyodbc 4.0.26
pyOpenSSL 19.0.0
pyparsing 2.4.0
PyQt5 5.12.3
PyQt5-sip 12.7.0
PyQtWebEngine 5.12.1
pyrsistent 0.14.11
pyserial 3.4
PySocks 1.6.8
pytest 4.4.1
pytest-arraydiff 0.3
pytest-astropy 0.5.0
pytest-doctestplus 0.3.0
pytest-openfiles 0.3.2
pytest-remotedata 0.3.1
python-dateutil 2.8.0
python-jsonrpc-server 0.3.2
python-language-server 0.31.2
pytz 2019.1
PyWavelets 1.0.3
PyYAML 5.1
pyzmq 18.0.0
QDarkStyle 2.7
QtAwesome 0.5.7
qtconsole 4.6.0
QtPy 1.7.0
requests 2.21.0
rope 0.14.0
ruamel-yaml 0.15.46
s3transfer 0.2.1
scikit-image 0.15.0
scikit-learn 0.20.3
scipy 1.2.1
seaborn 0.9.0
selenium 3.141.0
Send2Trash 1.5.0
setuptools 41.0.1
simplegeneric 0.8.1
singledispatch 3.4.0.3
six 1.13.0
smart-open 1.8.4
smmap2 2.0.5
snowballstemmer 1.2.1
sortedcollections 1.1.2
sortedcontainers 2.1.0
soupsieve 1.8
Sphinx 2.0.1
sphinxcontrib-applehelp 1.0.1
sphinxcontrib-devhelp 1.0.1
sphinxcontrib-htmlhelp 1.0.2
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.2
sphinxcontrib-serializinghtml 1.1.3
sphinxcontrib-websupport 1.1.0
spyder 4.0.0
spyder-kernels 1.8.1
SQLAlchemy 1.3.3
statsmodels 0.9.0
sympy 1.4
tables 3.4.4
tabulate 0.8.6
tblib 1.3.2
tensorboard 1.6.0
tensorflow 1.7.0rc1
tensorflow-tensorboard 1.5.1
termcolor 1.1.0
terminado 0.8.2
testpath 0.4.2
toolz 0.9.0
tornado 6.0.2
tqdm 4.31.1
traitlets 4.3.2
typed-ast 1.3.4
typing 3.6.4
ujson 1.35
unicodecsv 0.14.1
urllib3 1.24.2
visitor 0.1.3
watchdog 0.9.0
wcwidth 0.1.7
webencodings 0.5.1
webkit-server 1.0
Werkzeug 0.15.2
wheel 0.33.1
widgetsnbextension 3.4.2
wrapt 1.11.1
wurlitzer 2.0.0
xlrd 1.2.0
XlsxWriter 1.1.7
xlwings 0.15.6
xlwt 1.2.0
xvfbwrapper 0.2.9
yapf 0.29.0
zict 0.1.4
zipp 0.6.0