How do I set the PYTHONPATH on Cygwin?

前端 未结 2 1726
广开言路
广开言路 2021-01-19 12:58

In the Biopython installation instructions, it says that if Biopython doesn\'t work I\'m supposed to do this:

export PYTHONPATH = $PYTHONPATH\':/directory/where/you/

2条回答
  •  野性不改
    2021-01-19 13:46

    You can add the directory to your sys.path list

    import sys
    biopythondir = '/where/you/put/biopython'
    if biopythondir not in sys.path:
      sys.path.append(biopythondir)
    
    # import seq
    

    Or, for a more elegant solution than mucking around with environment variables and sys.path, see how to use .pth files to extend sys.path.

提交回复
热议问题