I reckon the easiest/cleanest solution would be to use a tool that isolates your python environment, such as virtualenv
Once installed, create a virtual env by specifying which version of python you want to use:
$> virtualenv -p python3 env
Note: puttin python3
directly works only for mac, with linux, you must specify the absolute path or your python binary.
And then ‘activate’ your environment:
$> source env/bin/activate
From here, any python or pip command you use will use python3.
$> pip install xlrd
Virtualenv has the advantage of not ‘polluting’ your local python installation, your can manage your pip modules installed more easily.
If you want more detail on how it works and the other alternatives, check this post
Related Posts:
- TypeError: list indices must be integers or slices, not list
- Relative imports in Python 3
- ModuleNotFoundError: No module named ‘requests’. But ‘requests’ already installed
- What are type hints in Python 3.5?
- ImportError: No module named ‘keras’
- TypeError: slice indices must be integers or None or have an __index__ method
- ImportError: libcublas.so.9.0: cannot open shared object file
- How to import cv2 in python3?
- ‘python3’ is not recognized as an internal or external command, operable program or batch file
- Unable to initialize device PRN in Python
- Error when executing `jupyter notebook` (No such file or directory)
- python3 is not recognized as an internal or external command, operable program or batch file showing for creating django runserver
- python3 : The term ‘python3’ is not recognized as the name of a cmdlet
- How can I solve ” module ‘pandas’ has no attribute ‘scatter_matrix’ ” error?
- Install numpy on python3.3 – Install pip for python3
- How to import cv2 in python3?
- Why did ‘reset_index(drop=True)’ function unwantedly remove column?
- TypeError: list indices must be integers, not float
- Python 3 – ValueError: not enough values to unpack (expected 3, got 2)
- python 3 – x for x for loops – how do they work?
- Visual Studio Python “Failed to launch the Python Process, please validate the path ‘python” & Error: spawn python ENOENT
- WinError 10061 – No Connection Could be made
- how do I upgrade pip on Mac?
- SyntaxError: unexpected EOF while parsing
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
- How to install pip with Python 3?
- Import Error: No module named numpy
- Python3 – ModuleNotFoundError: No module named ‘numpy’
- TypeError: a bytes-like object is required, not ‘str’ when writing to a file in Python3
- Pip freeze vs. pip list
- Best way to convert string to bytes in Python 3?
- TypeError: not all arguments converted during string formatting python
- Should I put #! (shebang) in Python scripts, and what form should it take?
- Should I put #! (shebang) in Python scripts, and what form should it take?
- Using Python 3 in virtualenv
- WinError 2 The system cannot find the file specified (Python)
- hashlib.md5() TypeError: Unicode-objects must be encoded before hashing
- Could not find a version that satisfies the requirement tensorflow
- Local variable referenced before assignment?
- Can’t fix “zipimport.ZipImportError: can’t decompress data; zlib not available” when I type in “python3.6 get-pip.py”
- ‘method’ object is not subscriptable. Don’t know what’s wrong
- error UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte
- Error in Python script “Expected 2D array, got 1D array instead:”?
- Error: ” ‘dict’ object has no attribute ‘iteritems’ “
- How to upgrade pip3?
- Name ‘xrange’ is not defined in Python 3 [duplicate]
- SystemError: Parent module ” not loaded, cannot perform relative import
- Error: ” ‘dict’ object has no attribute ‘iteritems’ “
- TypeError: ‘<=' not supported between instances of 'str' and 'int' [duplicate]
- TypeError: unsupported operand type(s) for -: ‘str’ and ‘int’
- How to upgrade pip3?
- Getting a map() to return a list in Python 3.x
- How to Read .txt in Pandas
- TypeError: cannot convert the series to
- Pinging servers in Python
- Add Legend to Seaborn point plot
- ‘End of statement expected’ in pycharm
- How to pass arguments to a Button command in Tkinter?
- How to remove specific substrings from a set of strings in Python?
- ‘str’ object has no attribute ‘decode’. Python 3 error?
- enumerate() for dictionary in python
- PermissionError: [WinError 5] Access is denied
- Create a .csv file with values from a Python list
- How can I install Python’s pip3 on my Mac?
- How to get the current working directory using python 3?
- min() arg is an empty sequence
- UnicodeDecodeError: ‘charmap’ codec can’t decode byte X in position Y: character maps to
- What is the meaning of ‘for _ in range()
- Virtualenv – workon command not found
- Python: AttributeError: ‘_io.TextIOWrapper’ object has no attribute ‘split’
- Pip – Fatal error in launcher: Unable to create process using ‘”‘
- ImportError: No module named ‘yaml’
- TypeError: ‘_io.TextIOWrapper’ object is not subscriptable
- Error: OOM when allocating tensor with shape
- Properly formatted multiplication table
- Why is parenthesis in print voluntary in Python 2.7?
- How to print multiple lines of text with Python
- How to compare individual characters in two strings in Python 3
- How do I run pip on python for windows?
- Need to install urllib2 for Python 3.5.1
- ImportError: No module named ‘xlrd’
- python: can’t open file ‘manage.py’: [Errno 2] No such file or directory
- Moving Average Pandas
- What does {0} mean in this Python string?
- Tab Error in Python
- Python 3.5.1 urllib has no attribute request
- Why do I get this error “TypeError: ‘method’ object is not iterable”?
- What is the purpose of dollar sign in this Python3 string formatting expression?
- What is the meaning of “int(a[::-1])” in Python?
- Why would cv2.COLOR_RGB2GRAY and cv2.COLOR_BGR2GRAY give different results?
- Getting a name error when trying to input a string [duplicate]
- How to install NumPy for Python 3.6
- TypeError: fit() missing 1 required positional argument: ‘y’
- Error loading MySQLdb module: No module named ‘MySQLdb’
- How do you switch between python 2 and 3, and vice versa?
- Iterating over dictionary items(), values(), keys() in Python 3
- Python 3 integer division [duplicate]
- Python – difference between two strings