Sublime text python cant find main2/21/2024 Note that in particular the default just executes python and leaves it up to you to ensure that this works as expected on some systems this will execute Python 2 instead of Python 3, for example.īased on your problem, you’re not using that built in build system and are instead using either one you created yourself or one provided by an add on package, and by the description of your problem and confusion over the use of the -OO flag, it’s probably the latter. ![]() The sublime-build file that ships with Sublime for executing Python programs is Python/Python.sublime-build, which looks like this: \"", Like every other language that Sublime supports (both natively and through external packages), external programs are executed using the contents of a sublime-build file that’s set up to tell Sublime how it should execute those programs and in what way. This problem persists across multiple work stations running the identical environment. Running without the flag operates as expected. When passing this flag in a bash environment I am able to recreate this error outside of ST3. ![]() bash_profile.Īdditionally ST3 seems to be calling the -OO flag. I am not sure how to alter the $PATH in sublime or have it point to my $PATH defined in. The $PATH listed in the error message from sublime is not the same as $PATH in bash. home//.local/lib/python3.6/site-packages/textblob The version of pip I have prompts users to use the -user flag when installing libraries. In the second example I imported textblob. usr/lib64/python2.7/site-packages/numpy/core/include/numpy usr/lib64/python3.6/site-packages/numpy/core/include/numpy In my first example I imported Numpy, which I installed with my distros packages manager. Sublime is only seeing packages installed at the global level, not the user level. If I launch python from a terminal and import textblob the following returns: > import textblob Start_of_notes = cls_docstring.find(notes_header)ĪttributeError: 'NoneType' object has no attribute 'find' blob import TextBlob, Word, Sentence, Blobber, WordListįile "/home//.local/lib/python3.6/site-packages/textblob/blob.py", line 28, in įile "/home//.local/lib/python3.6/site-packages/nltk/_init_.py", line 114, in įile "/home//.local/lib/python3.6/site-packages/nltk/collocations.py", line 39, in įrom trics import ContingencyMeasures, BigramAssocMeasures, TrigramAssocMeasuresįile "/home//.local/lib/python3.6/site-packages/nltk/metrics/_init_.py", line 16, in įrom import (accuracy, precision, recall, f_measure,įile "/home//.local/lib/python3.6/site-packages/nltk/metrics/scores.py", line 18, in įile "/home//.local/lib/python3.6/site-packages/scipy/stats/_init_.py", line 345, in įile "/home//.local/lib/python3.6/site-packages/scipy/stats/stats.py", line 171, in įile "/home//.local/lib/python3.6/site-packages/scipy/stats/distributions.py", line 13, in įile "/home//.local/lib/python3.6/site-packages/scipy/stats/_continuous_distns.py", line 113, in įile "/home//.local/lib/python3.6/site-packages/scipy/stats/_continuous_distns.py", line 175, in norm_genįile "/home//.local/lib/python3.6/site-packages/scipy/misc/doccer.py", line 159, in _doc Returns: Traceback (most recent call last):įile "/home//.local/lib/python3.6/site-packages/textblob/_init_.py", line 2, in įrom. For example:Ī file containing the following: import numpy ![]() When I import user installed python libraries ST3 fails to import some, but not all libraries. ![]() # Running the following from inside sublime: $ pip -version # returns: pip 10.0.1 from /home//.local/lib/python3.6/site-packages/pip (python 3.6) $ python -version # returns: Python 3.6.6 $ subl -version # returns: Sublime Text Build 3176 My Env $ uname -ro # returns: 4.17.86_64 GNU/Linux
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |