Prachi,

I feel your struggle. It is easier for end user to perceive Python 2 and Python 3 as different languages, not as versions of one language. They usually installed alongside each other; their updates are handled separately. On most systems they have their respective shell commands: `python2` and `python3`.

Shell command `python` can be viewed as an alias of either `python2` or `python3`. I use an Arch Linux derivative, where `python` is `python3`. Most other GNU/Linux OSes use `python` as an alias of `python2`. I am not sure about MacOS. On Windows the latest Python distribution installed overrule PATH environment variables, so it impossible to predict the “default” Python version (2 or 3).

Luckily, virtualenv was introduced to leverage all these issues. It is able to handle multiple isolated Python environments, where the `python` command is set upon the creation of the environment, while the environment-specific package dependencies are handled transparently with pip.

But the use of pyignite should not be limited to virtualenv. There are many cases when the use of virtualenv is discouraged or even impossible. For example, when deploying Python app into an OS-level container or similar isolating environment, virtualenv would be just a useless overhead. There are also non-standard Python distributions (used mostly on Windows) that do not support virtualenv.

I am sorry, that users who are not proficient in Python can have so many problems with following my documentation. But still it seems obvious for me, that all the details of organizing user's own Python environment are out of pyignite documentation's scope. The only thing I can suggest to improve my documentation in this regard is putting a big bold foreword like this:

  It is assumed in this document that you know how to install
  and use Python 3 on your system. Please consult your OS manual pages
  or documentations of your specific Python 3 distribution regarding
  the details of organizing your Python 3 environment. The use of
  virualenv for development with pyignite is highly recommended.

But, frankly, I have not seen such disclaimers in the wild and not sure if it would be useful. It is very vague and do not cover any of the potential pitfalls.

I am sorry for giving such a lengthy explanation here, though I've been asked a very specific question. I understand you may not have time to invest in learning virtualenv. If so, you did everything right, just use `python3` command for launching examples:

```
$ python3 get_and_put.py
```

On 9/21/18 10:34 AM, Prachi Garg wrote:
Hi Dmitry,

Sorry, I am not familiar with Python.

So there are more issues...

1. The version on my mac remains 2.7.10 even though I tried to link to the new version.

~$ python --version
Python 2.7.10

~$ brew unlink python && brew link --overwrite python3
Unlinking /usr/local/Cellar/python/3.7.0. <http://3.7.0.>.. 25 symlinks removed Linking /usr/local/Cellar/python/3.7.0. <http://3.7.0.>.. 25 symlinks created

~$ python --version
Python 2.7.10

2. Then I tried to update /pip/, uninstall and re-install /pyignite/

~$ pip install -U pip
-bash: /Library/Frameworks/Python.framework/Versions/3.7/bin/pip: No such file or directory
~$ pip3 install -U pip
Requirement already up-to-date: pip in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (18.0)

~$ pip3 uninstall pyignite
Uninstalling pyignite-0.3.0:
   Would remove:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyignite-0.3.0.dist-info/* /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyignite/*
Proceed (y/n)? y
   Successfully uninstalled pyignite-0.3.0

~$ pip3 install pyignite
Collecting pyignite
  Using cached https://files.pythonhosted.org/packages/f1/0f/5669cd63fb37fa2025110f61598450567d04a72c8cf5b76bb0ca20c21734/pyignite-0.3.0-py3-none-any.whl Requirement already satisfied: attrs==18.1.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pyignite) (18.1.0) Requirement already satisfied: typing==3.6.4 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pyignite) (3.6.4)
Installing collected packages: pyignite
Successfully installed pyignite-0.3.0


How can I fix this?

On Wed, Sep 19, 2018 at 6:43 PM, Dmitry Melnichuk <dmitry.melnic...@nobitlost.com <mailto:dmitry.melnic...@nobitlost.com>> wrote:

    Prachi,

    This line in your message

    > Requirement already satisfied: pyignite in
    > ./Downloads/ignite-python/modules/platforms/python (0.3.1)

    looks like you already did an installation of pyignite in this
    environment before (maybe with "pip install -e <location of
    setup.py>") from 'Downloads' folder, then delete or move downloaded
    copy, and than tried to install pyignite again, this time from PyPI
    ("pip install <package name>").

    pip does not work this way. You should either undo the previous
    install ("pip uninstall <package name>"), use "--update" argument
    ("pip install --update <package_name>"), or even better − use
    virtualenv to create a disposable Python environment for every
    experiment. I provided a link to virtualenv manual in the README
    file and in docs, in the 'Basics → Testing' section.

    > Also, the installation instruction you have provided are for unix users.
    > What are the installation instructions for Windows users?

    I tried to be OS-agnostic in the docs. Please tell me, what part of
    my instructions does not work on Windows.

    On 9/20/18 7:32 AM, Prachi Garg wrote:

        Hi Dmitry,

        I tried to follow the instructions for the Python thin client
        installation [1].

        ~$ pip install pyignite
        Requirement already satisfied: pyignite in
        ./Downloads/ignite-python/modules/platforms/python (0.3.1)
        Requirement already satisfied: typing==3.6.4 in
        
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
        (from pyignite) (3.6.4)
        Requirement already satisfied: attrs==18.1.0 in
        
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
        (from pyignite) (18.1.0)

        But when I try to run an example, I get an error.

        ~/Downloads/ignite-python/modules/platforms/python/examples$
        python get_and_put.py
        Traceback (most recent call last):
            File "get_and_put.py", line 16, in <module>
              from pyignite import Client
        ImportError: No module named pyignite


        What else need to be done? I am documenting the instructions on
        readme.io <http://readme.io> <http://readme.io>, but I need to
        be able to run a few examples first.

        Also, the installation instruction you have provided are for
        unix users. What are the installation instructions for Windows
        users?

        [1]
        
https://apache-ignite-binary-protocol-client.readthedocs.io/en/latest/readme.html#installation
        
<https://apache-ignite-binary-protocol-client.readthedocs.io/en/latest/readme.html#installation>




Reply via email to