Comments (2)
Brilliant! Your first option which is forcing pip to target python3.6 worked pretty well. In addition to your suggestion, I had to use one more prerequisite step to get pip module first for python3.6.
- curl https://bootstrap.pypa.io/get-pip.py | sudo -H python3.6
- python3.6 -m pip install berserk
The Berserk is a fabulous 🥇 package within both its name and functionality, now I do not need to develop another parser with BeautifulSoup (I hope :)
cheers 👍
from berserk.
So pip and python can be confusing sometimes. I think what's happening here is that you're using the wrong pip to install the dependency. Note that when you run pip3 install berserk
it prints out that lots of requirements are already satisfied but the paths are for a python2.7/site-packages directory. Obviously, something isn't right there. Two things can help to avoid these problems: virtual environments and python module execution.
Let's talk about python module execution first. Python provides a -m
flag that accepts a module name as an argument and invokes the module as a program. The syntax is
<PYTHON> -m <MODULE_NAME> [<ARGS>...]
Notable examples are the HTTP server for serving the current directory of files over some port and the JSON module for pretty-printing:
$ python2.7 -m SimpleHTTPServer 8000
$ python3 -m http.server 9000 # module is different for python3
$ echo '{"foo": "bar", "baz": "qux"}' | python -m json.tool
{
"baz": "qux",
"foo": "bar"
}
Because pip installs packages to a specific python version, I always recommend running pip as a module because it forces you to invoke it with a specific version of python:
$ python3.6 -m pip install berserk
$ python2.7 -m pip install berserk
Using this method, there's no ambiguity or confusion as to which python's site-packages directory will be used for installation.
Secondly, virtual environments are a tool for creating isolated python environments and are highly recommended both when developing or hacking on packages and when deploying to a production machine. There are many tools out there for creating environments (read up on virtualenv, pyvenv, tox, and pipenv), but here's how I would create one to work on berserk:
$ python3.6 -m venv env
$ source env/bin/activate
[env] $ pip install berserk
A couple of things to note here. Firstly, I create the environment using the venv module through a specific version of python (3.6 in this case) to avoid any confusion. Secondly, after I create the environment I "activate" it. This changes my sys path so that when I run python
I get the specific version of python used to create the virtual environment. It also makes pip
refer to the specific version of pip that will install packages to the site-packages directory of the python for my virtual environment. That is to say, once my virtual environment is activated, python
and pip
are the right python
and pip
without having to worry.
tl;dr: use virtual environments to isolate installations from each other and system python. Use module execution when outside of a virtual environment to remove any ambiguity.
Last tip: you can invoke the site
module to see which directories it checks for installed packages:
$ python3.6 -m site
sys.path = [
'/Users/rhgrant10/code',
'/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python36.zip',
'/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6',
'/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload',
'/Users/rhgrant10/Library/Python/3.6/lib/python/site-packages',
'/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages',
]
USER_BASE: '/Users/rhgrant10/Library/Python/3.6' (exists)
USER_SITE: '/Users/rhgrant10/Library/Python/3.6/lib/python/site-packages' (exists)
ENABLE_USER_SITE: True
Let me know how you get on :)
from berserk.
Related Issues (20)
- get_rating_hist returns raw json string instead of list HOT 1
- export_by_player incorrect work of a boolean argument rated HOT 1
- Play against AI problem. HOT 2
- How know the type of color on a challenge Random Color? HOT 1
- No method for api/tournament/{id}
- Use discord to launch lichess game and invite players to play, then be able to grab the game information after . HOT 1
- Add the openingExplorerLichess for master/lichess games HOT 1
- Oauth2 HOT 1
- Can't call get_activity_feed HOT 8
- Berserk `since` and `until` should be integers HOT 1
- `sort` parameter missing from export_by_player?
- using API from Alexa skill to play unlimited engine game HOT 2
- Challenge result does not reflect color HOT 1
- Get tournament bug HOT 1
- Two users at the same time?
- http.client.RemoteDisconnected: Remote end closed connection without response HOT 1
- TypeError using create_open meathod on raspian with Python 3.9 and lastest bersek version
- ChunkedEncodingError While extracting the data
- board seek function increment parameter in seconds, not minutes
- Lichess improving berserk UX HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from berserk.