km-git-acc / dbn_upper_bound

Computational effort to upper bound the de Bruijn-Newman constant as part of a Polymath project
Other
13 stars 12 forks source link

Virtual environment issues #42

Open sujitnair opened 6 years ago

sujitnair commented 6 years ago

@km-git-acc @dhjpolymath @mariotrevi

Hi All, there are very good reasons to use a virtual environment. One of them is you don't want to mess with your system files and potentially make your machine unbootable!

@mariotrevi
The following error indicates that you don't have pip in your system. Error: Command '['/home/david/dbn/dbn_upper_bound/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

As this StackOverflow post suggests (https://stackoverflow.com/questions/26215790/venv-doesnt-create-activate-script-python3), you can do the following

  1. Create a virtual environment without pip
  2. Add pip into this newly created virtual env

The steps are

  1. python3 -m venv --without-pip testvenv (creates a virtual env called testvenv)
  2. source testvenv/bin/activate (get inside the virtual env)
  3. curl https://bootstrap.pypa.io/get-pip.py | python (install pip)
  4. deactivate (get out of the venv)
  5. source testvenv/bin/activate (get back in the venv)

Hope this helps resolve. Let me know if you still have issues. But we need to make sure venv works and not be messing with the system files. Towards that end, I have to revert some recent changes in the import statement.

I am happy to help out!

Sujit

mariotrevi commented 6 years ago

@Sujit Nair,

On 02/13/2018 05:06 PM, Sujit Nair wrote:

@km-git-acc https://github.com/km-git-acc @dhjpolymath https://github.com/dhjpolymath @mariotrevi https://github.com/mariotrevi

Hi All, there are very good reasons to use a virtual environment. One of them is you don't want to mess with your system files and potentially make your machine unbootable!

@mariotrevi https://github.com/mariotrevi The following error indicates that you don't have pip in your system. Error: Command '['/home/david/dbn/dbn_upper_bound/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

As this StackOverflow post suggests (https://stackoverflow.com/questions/26215790/venv-doesnt-create-activate-script-python3), you can do the following

  1. Create a virtual environment without pip
  2. Add pip into this newly created virtual env

The steps are

  1. python3 -m venv --without-pip testvenv (creates a virtual env called testvenv)
  2. source test4/bin/activate (get inside the virtual env)
  3. curl https://bootstrap.pypa.io/get-pip.py | python (install pip)
  4. deactivate (get out of the venv)
  5. source test4/bin/activate (get back in the venv)

Hope this helps resolve. Let me know if you still have issues. But we need to make sure venv works and not be messing with the system files. Towards that end, I have to revert some recent changes in the import statement.

Thanks! The virtual environment is now working.

The latest problem is an SSL problem :

$ pip -V pip 9.0.1 from /home/david/dbn/dbn_upper_bound/venv/lib/python3.6/site-packages (python 3.6)

$ pip install -r python_requirements.txt [ENTER]

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting numpy==1.14.0 (from -r python_requirements.txt (line 1))   Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping   Could not find a version that satisfies the requirement numpy==1.14.0 (from -r python_requirements.txt (line 1)) (from versions: ) No matching distribution found for numpy==1.14.0 (from -r python_requirements.txt (line 1))

$pwd

/home/david/dbn/dbn_upper_bound

$ls -l

-rw-rw-r--. 1 david david    1457 Feb 13 14:39 CODE_OF_CONDUCT.md -rw-rw-r--. 1 david david    1653 Feb 13 14:39 CONTRIBUTING.md drwxrwxr-x. 6 david david      79 Feb 13 14:39 dbn_upper_bound -rw-r--r--. 1 root  root  1595408 Feb 13 16:27 get-pip.py -rw-rw-r--. 1 david david      84 Feb 13 14:39 LICENSE drwxrwxr-x. 4 david david      34 Feb 13 14:39 output -rw-rw-r--. 1 david david   10783 Feb 13 14:39 pylintrc -rw-rw-r--. 1 david david      54 Feb 13 14:39 python_requirements.txt -rw-rw-r--. 1 david david    3297 Feb 13 14:39 README.md drwxrwxr-x. 5 david david      74 Feb 13 14:40 venv

David

I am happy to help out!

Sujit

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/km-git-acc/dbn_upper_bound/issues/42, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_If3oj8I8ax-OzYgf6iDMcSfimgDqhks5tUgdagaJpZM4SEeb-.

sujitnair commented 6 years ago

I had the same issue on my Mac and had to resolve it with homebrew.

@mariotrevi Did you

  1. compile python from source?
  2. what is your OS?
mariotrevi commented 6 years ago

@SujitNair ,

On 02/13/2018 10:28 PM, Sujit Nair wrote:

I had the same issue on my Mac and had to resolve it with homebrew.

@mariotrevi https://github.com/mariotrevi Did you

  1. compile python from source?

yes

  1. what is your OS?

CenOS  7

I installed the package openssl-devel for CentOS, and also zlib.

With that, venv and pip install ...etc    both work.

I'm running a test:

$ PYTHONPATH=. python3 dbn_upper_bound/python/sample_afe_abc_calc.py 27.89514023755035243852001274703497930375 38.90521395022891792405560861557034330778 48.01144462650417039143734996837175308578 60.81060532111731825606846990165844520796 65.91417859981307952578114046128233957994 [...]

from the "root" project directory, dbn_upper_bound

It's still running.

David

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/km-git-acc/dbn_upper_bound/issues/42#issuecomment-365484914, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_If52by72eDAEA7pf0nIfH9LOMbxMrks5tUlLugaJpZM4SEeb-.

sujitnair commented 6 years ago

That's awesome. Looking forward to your first PR!