0

Apologies in advanced for this common amateur mistake it seems, of conflicting installations.

I've been getting "Import Error" on scripts unable to find "requests" module; it wasn't making sense till I saw the python launch path was '/usr/bin/python2.7'

This isn't the same version of Python that runs from Terminal on my system. I installed Python from the binary off the general website. When launching '/usr/bin/python2.7' in terminal then checking modules via help("modules"):

Please wait a moment while I gather a list of all available modules...

    Using library at path:
    - /Library/Frameworks/R.framework/Versions/3.5/Resources/library
    /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py:674: RuntimeWarning: Error parsing BridgeSupport data for AVFoundation: PyObjCRT_SkipTypeSpec: Unhandled type '5d' ]}
      warnings.warn("Error parsing BridgeSupport data for %s: %s" % (frameworkName, e), RuntimeWarning)
    2018-08-07 15:30:19.211 Python[2016:33399] Cannot find executable for CFBundle 0x7fa27ed88730 </System/Library/Frameworks/Message.framework> (not loaded)
AVFoundation        __builtin__         dl                  pwd
Accounts            __future__          doctest             py2app
AddressBook         _abcoll             dumbdbm             py_compile
AppKit              _ast                dummy_thread        pyclbr
AppleScriptKit      _bisect             dummy_threading     pydoc
AppleScriptObjC     _builtinSuites      easy_install        pydoc_data
Audio_mac           _codecs             email               pyexpat
Automator           _codecs_cn          encodings           pygments
BaseHTTPServer      _codecs_hk          ensurepip           pylab
Bastion             _codecs_iso2022     errno               pyparsing
CFNetwork           _codecs_jp          exceptions          pytz
CFOpenDirectory     _codecs_kr          fcntl               quopri
CGIHTTPServer       _codecs_tw          filecmp             random
Canvas              _collections        fileinput           rapi
Carbon              _csv                findertools         re
Cocoa               _ctypes             fnmatch             readline
CodeWarrior         _ctypes_test        formatter           repr
Collaboration       _curses             fpformat            resource
ColorPicker         _curses_panel       fractions           rexec
ConfigParser        _elementtree        ftplib              rfc822
Cookie              _functools          functools           rlcompleter
CoreData            _hashlib            future_builtins     robotparser
CoreFoundation      _heapq              gc                  rtichoke
CoreGraphics        _hotshot            genericpath         runpy
CoreLocation        _io                 gensuitemodule      sched
CoreText            _json               gestalt             scipy
Dialog              _locale             getopt              select
DictionaryServices  _lsprof             getpass             sets
DocXMLRPCServer     _markerlib          gettext             setuptools
EasyDialogs         _multibytecodec     glob                sgmllib
EventKit            _multiprocessing    grp                 sha
ExceptionHandling   _osx_support        gzip                shelve
Explorer            _pyio               hashlib             shlex
FSEvents            _random             heapq               shutil
FileDialog          _scproxy            hmac                signal
Finder              _socket             hotshot             site
FixTk               _sqlite3            htmlentitydefs      six
Foundation          _sre                htmllib             smtpd
FrameWork           _ssl                httplib             smtplib
HTMLParser          _strptime           ic                  sndhdr
IN                  _struct             icglue              socket
InputMethodKit      _symtable           icopen              sqlite3
InstallerPlugins    _sysconfigdata      idlelib             sre
InstantMessage      _testcapi           ihooks              sre_compile
JavaScriptCore      _threading_local    imageop             sre_constants
LatentSemanticMapping _tkinter            imaplib             sre_parse
LaunchServices      _warnings           imghdr              ssl
MacOS               _weakref            imp                 stat
Message             _weakrefset         importlib           statvfs
MimeWriter          abc                 imputil             string
MiniAEFrame         aepack              inspect             stringold
Nav                 aetools             io                  stringprep
Netscape            aetypes             itertools           strop
OSATerminology      aifc                json                struct
OpenDirectory       altgraph            keyword             subprocess
OpenSSL             antigravity         lib2to3             sunau
PixMapWrapper       anydbm              linecache           sunaudio
PreferencePanes     applesingle         lineedit            symbol
PubSub              appletrawmain       locale              symtable
PyObjCTools         appletrunner        logging             sys
QTKit               argparse            macerrors           sysconfig
Quartz              argvemulator        macholib            syslog
Queue               array               macostools          tabnanny
ScreenSaver         ast                 macpath             tarfile
ScriptingBridge     asynchat            macresource         telnetlib
ScrolledText        asyncore            macurl2path         tempfile
SearchKit           atexit              mailbox             terminalcommand
ServiceManagement   audiodev            mailcap             termios
SimpleDialog        audioop             markupbase          test
SimpleHTTPServer    autoGIL             marshal             tests
SimpleXMLRPCServer  base64              math                textwrap
Social              bdb                 matplotlib          this
SocketServer        bdist_mpkg          md5                 thread
StdSuites           bgenlocations       mhlib               threading
StringIO            binascii            mimetools           time
SyncServices        binhex              mimetypes           timeit
SystemConfiguration bisect              mimify              tkColorChooser
SystemEvents        bonjour             mmap                tkCommonDialog
Tix                 bsddb               modulefinder        tkFileDialog
Tkconstants         bsddb185            modulegraph         tkFont
Tkdnd               buildtools          multifile           tkMessageBox
Tkinter             bundlebuilder       multipledispatch    tkSimpleDialog
UserDict            bz2                 multiprocessing     toaiff
UserList            cPickle             mutex               token
UserString          cProfile            netrc               tokenize
WebKit              cStringIO           new                 trace
_AE                 calendar            nis                 traceback
_AH                 cfmfile             nntplib             ttk
_App                cgi                 ntpath              tty
_CF                 cgitb               nturl2path          turtle
_CG                 chunk               numbers             types
_CarbonEvt          cmath               numpy               unicodedata
_Cm                 cmd                 objc                unittest
_Ctl                code                opcode              urllib
_Dlg                codecs              operator            urllib2
_Drag               codeop              optparse            urlparse
_Evt                collections         os                  user
_File               colorsys            os2emxpath          uu
_Fm                 commands            parser              uuid
_Folder             compileall          pdb                 videoreader
_Help               compiler            pickle              warnings
_IBCarbon           contextlib          pickletools         wave
_Icn                cookielib           pimp                wcwidth
_LWPCookieJar       copy                pip                 weakref
_Launch             copy_reg            pipes               webbrowser
_List               crypt               pkg_resources       whichdb
_Menu               csv                 pkgutil             wsgiref
_Mlte               ctypes              platform            xattr
_MozillaCookieJar   curses              plistlib            xdrlib
_OSA                datetime            popen2              xml
_Qd                 dateutil            poplib              xmllib
_Qdoffs             dbhash              posix               xmlrpclib
_Qt                 dbm                 posixfile           xxsubtype
_Res                decimal             posixpath           zipfile
_Scrap              difflib             pprint              zipimport
_Snd                dircache            profile             zlib
_TE                 dis                 pstats              zope
_Win                distutils           pty

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

Clearly there seems to be multiple instances. How do I fix this? It seems it's defaulting to Version 3 on top of using an incorrect installation? Ideally I imagine I'd want one version that would be the default. ALL Help is greatly appreciated!

aisync
  • 175
  • 6
  • `R.framework`? That is not something I would have expected to see in that output. – user2357112 supports Monica Aug 07 '18 at 22:55
  • That part is consistent/persistent with both "Python" or '/usr/bin/python2.7' Although with the former I don't get that above warning about the executable. – aisync Aug 07 '18 at 22:59
  • dup of https://stackoverflow.com/questions/18425379/how-to-set-pythons-default-version-to-3-3-on-os-x – Ywapom Aug 07 '18 at 23:03
  • My bash_profile: ```#Path export PATH=/usr/local/bin:/usr/local/sbin:$PATH # Setting PATH for Python 2.7 # The original version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH``` – aisync Aug 07 '18 at 23:05
  • https://stackoverflow.com/a/51727268/1135424 in case you would like multiple versions – nbari Aug 08 '18 at 15:06
  • i suggest you create a virtual environment for the version of Python you want to run. – Natsfan Aug 08 '18 at 22:08

0 Answers0