F5Networks / f5-common-python

Python SDK for configuration and monitoring of F5® BIG-IP® devices via the iControl® REST API.
https://f5-sdk.readthedocs.org
Apache License 2.0
262 stars 134 forks source link

Installing F5 via `pip` fails to install dependencies #1106

Closed mindw closed 7 years ago

mindw commented 7 years ago

f5-sdk 2.3.1:

 mkvirtualenv f5-test
Using base prefix '/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5'
New python executable in /Users/gabdav01/.virtualenvs/f5-test/bin/python3.5
Also creating executable in /Users/gabdav01/.virtualenvs/f5-test/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /Users/gabdav01/.virtualenvs/f5-test/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/gabdav01/.virtualenvs/f5-test/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/gabdav01/.virtualenvs/f5-test/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/gabdav01/.virtualenvs/f5-test/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/gabdav01/.virtualenvs/f5-test/bin/get_env_details
(f5-test)
$ pip install f5-sdk
Collecting f5-sdk
Installing collected packages: f5-sdk
Successfully installed f5-sdk-2.3.1
$ python
Python 3.5.2 (default, Oct 11 2016, 21:06:00)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import f5
>>> from f5.bigip import ManagementRoot
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/gabdav01/.virtualenvs/f5-test/lib/python3.5/site-packages/f5/bigip/__init__.py", line 20, in <module>
    from icontrol.session import iControlRESTSession
ImportError: No module named 'icontrol'
>>>

$ pip list  --format=columns
Package    Version
---------- -------
appdirs    1.4.3
f5-sdk     2.3.1
packaging  16.8
pip        9.0.1
pyparsing  2.2.0
setuptools 34.4.0
six        1.10.0
wheel      0.29.0

$ pip show -v f5-sdk
Name: f5-sdk
Version: 2.3.1
Summary: F5 Networks Python SDK
Home-page: https://github.com/F5Networks/f5-common-python
Author: F5 Networks
Author-email: f5_common_python@f5.com
License: Apache License, Version 2.0
Location: /Users/gabdav01/.virtualenvs/f5-test/lib/python3.5/site-packages
Requires:
Metadata-Version: 2.0
Installer: pip
Classifiers:
  Development Status :: 5 - Production/Stable
  License :: OSI Approved :: Apache Software License
  Operating System :: OS Independent
  Programming Language :: Python
  Intended Audience :: System Administrators
Entry-points:
  [pytest11]
  f5sdk_fixtures = f5sdk_plugins.fixtures
rickardrosen commented 7 years ago

I get this on macos after pip install f5-sdk:

>>> import f5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "f5.py", line 1, in <module>
    from f5.bigip import bigip
ImportError: No module named bigip
pip show -v f5-sdk
Name: f5-sdk
Version: 2.3.1
Summary: F5 Networks Python SDK
Home-page: https://github.com/F5Networks/f5-common-python
Author: F5 Networks
Author-email: f5_common_python@f5.com
License: Apache License, Version 2.0
Location: /Users/rickard.rosen/Library/Python/2.7/lib/python/site-packages
Requires: f5-icontrol-rest, six, f5-icontrol-rest, six
Metadata-Version: 2.0
Installer: pip
Classifiers:
  Development Status :: 5 - Production/Stable
  License :: OSI Approved :: Apache Software License
  Operating System :: OS Independent
  Programming Language :: Python
  Intended Audience :: System Administrators
Entry-points:
  [pytest11]
  f5sdk_fixtures = f5sdk_plugins.fixtures
wojtek0806 commented 7 years ago

Please do not use bigip, as this fixture is deprecated. Correct way should be:

from f5.bigip import ManagementRoot

rickardrosen commented 7 years ago

This is what I'm seeing:

Traceback (most recent call last):
  File "f5.py", line 1, in <module>
    from f5.bigip import ManagementRoot
  File "/Users/rickard.rosen/Documents/github/consul-handler/f5.py", line 1, in <module>
    from f5.bigip import ManagementRoot
ImportError: No module named bigip
caphrim007 commented 7 years ago

@mindw @rickardrosen @quasarj is this still an issue?

mindw commented 7 years ago

Yep. Why wont it? there were no new releases.

caphrim007 commented 7 years ago

@mindw can you elaborate more on your particular setup? I want to repro and fix

caphrim007 commented 7 years ago

@mindw I was able to repro this for Python3. I've submitted a fix which appears to fix it in the environments I have. I think it will satisfy your env too.

caphrim007 commented 7 years ago

@rickardrosen @quasarj I believe this issue is now fixed in devel

jaymmodi commented 6 years ago

This is still an issue for me. I used `pip install f5-sdk'. I can see the package which is installed in my site-packages directory.

And I get this: ImportError: No module named bigip when I try to run this: from f5.bigip import ManagementRoot

caphrim007 commented 6 years ago

@jaymmodi open a new issue and provide details of your working environment please.