I have different python version on my Linux server running with
[xyz@innolx20122]$ python python python2.7 python3.6 python3.7 python3.7m-config python2 python3 python3.6m python3.7m
I want to use python3.7 version only so have made an alias in my
I have installed python invoke module which I am going to use further.
pip install invoke
It got installed at default python 2.7 location
[xyz@innolx20122 ~]$ pip install invoke DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: invoke in ./.local/lib/python2.7/site-packages (1.4.1)
I am facing issue when running invoke tasks as 2.7 version does not support **kwargs arguments. How can I fix this issue?
I created one more alias as
pip=pip3.7 [xyz@innolx20122 ~]$ pip --version pip 10.0.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
Now when I run pip install invoke, getting this issue.
[xyz@innolx20122 ~]$ pip install invoke Collecting invoke Using cached https://files.pythonhosted.org/packages/2c/16/f00efa99ae9f255142a230ce6819c37ae9dd29a7144477c1161cc72d01ed/invoke-1.4.1-py3-none-any.whl Installing collected packages: invoke Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/site-packages/invoke' Consider using the `--user` option or check the permissions. You are using pip version 10.0.1, however version 20.2.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
I tried using
pip install invoke --user
after this I could see package was installed at location
[xyz@innolx20122 ~]$ pip install invoke --user
Requirement already satisfied: invoke in ./.local/lib/python3.7/site-packages (1.4.1) You are using pip version 10.0.1, however version 20.2.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [xyz@innolx20122 ~]$ cd ./.local/lib/python3.7/site-packages [xyz@innolx20122 site-packages]$ ls invoke invoke-1.4.1.dist-info [xyz@innolx20122 ~]$ cd /usr/local/lib/python3.7/site-packages/ [xyz@innolx20122 site-packages]$ ls easy_install.py pip pip-10.0.1.dist-info pkg_resources __pycache__ README.txt setuptools setuptools-39.0.1.dist-info [xyz@innolx20122 sd-test]$ inv --list Trace back (most recent call last): File "/usr/bin/inv", line 8, in <module> sys.exit(program.run()) File "/home/xyz/.local/lib/python2.7/site-packages/invoke/program.py", line 373, in run self.parse_collection() File "/home/xyz/.local/lib/python2.7/site-packages/invoke/program.py", line 465, in parse_collection self.load_collection() File "/home/xyz/.local/lib/python2.7/site-packages/invoke/program.py", line 696, in load_collection module, parent = loader.load(coll_name) File "/home/xyz/.local/lib/python2.7/site-packages/invoke/loader.py", line 76, in load module = imp.load_module(name, fd, path, desc) File "/home/xyz/developer-workspace/vikrant-xyz/sd-test/tasks/__init__.py", line 5, in <module> from .airflow import * File "/home/xyz/developer-workspace/vikrant-xyz/sd--test/tasks/airflow.py", line 57 **airflow_vars,