Closed kellyyma closed 1 year ago
NB - Kelly and I are going through this together and the note is here because me need to make another strategic decision, which is whether to stick with the sometimes tricky pip based installation or to install via conda - @rayanc72 knows more, I think. The issue appears to be that Conda will, by default, install selenium > 4.3.0 at this time, whereas our requirements.txt specify selenium==3.141.0 . This only affects our testing, not the actual servers once they're in production. Nevertheless, the question is do we upgrade to > 4.3.0 and change our file tests.py to reflect the new selenium syntax.
I am for updating (always better) but we also need a documented process for a conda based install.
Those are the action items from this issue (sorry that we don't use the issue tracker more for logs like this one).
Hi @volkerblum,
Here's the complete installation guide while using the conda environment on a mac. We'll need to update the tests.py file at some point to work with this.
Before you proceed with the installation, ensure you have the following software installed on your system:
[* In older macs (using intel chips), MySQL installation needs to be carried out with the legacy password option.]
To get started, clone the MatD3 repository from GitHub:
git clone https://github.com/HybriD3-database/MatD3.git
Navigate to the MatD3 directory that was created after cloning the repository:
cd MatD3
create a new Conda environment for MatD3 using the following command:
conda create -n matd3_local pip
Activate the newly created environment using the following command:
conda activate matd3_local
Django
matplotlib
numpy
Pillow
python-dateutil
sentry-sdk
raven
python-decouple
django-nested-admin
djangorestframework
coverage
selenium
requests
Sphinx
gunicorn
sphinx_rtd_theme
django-filter>=2.4.0
pip install -r requirements.txt
DEFAULT_AUTO_FIELD='django.db.models.AutoField'
Copy the provided env.example file:
cp env.example .env
Additionally, if you wish to use MySQL:
Install MySQL client for conda
conda install -c conda-forge mysqlclient
in the .env file, specify that you are using MySQL:
set USE_SQLITE=False
(the Default is True
)
Create a database for using with MySQL:
mysql -u <your_mysql_username> -p
This should prompt you to provide your MySQL password. After entering that, use,
create database <your_database_name>;
exit;
# Database
...
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '<your_database_name>',
'USER': config('DB_USER', default='<your_mysql_username>'),
'PASSWORD': config('DB_PASSWORD', default='<your_mysql_password>'),
'HOST': 'localhost',
'PORT': '',
}
}
To Initialize static files and perform database migrations, run the following command:
./manage.py collectstatic
./manage.py migrate
Run the following command:
./manage.py createsuperuser
Run the following command:
./manage.py runserver
I'm closing this issue and opening a new one for updating the test.py to work with the updated Python modules.
I was trying to install MatD3 from scratch on my macbook using homebrew and eventually conda.
I had to install firefox (needs to be mentioned in instructions). More importantly, I also installed selenium as required. When running ./manage.py test I got the following error message: AttributeError: 'WebDriver' object has no attribute 'find_element_by_link_text' This leads to the following explanation online: https://stackoverflow.com/questions/72754331/webdriver-object-has-no-attribute-find-element-by-link-text-selenium-scrip which tells us that a particular line of code is no longer supported by selenium 4.3.0 and higher. We need to figure out if we need to upgrade the rest of the code base to request only selenium 4.3.0 and higher and what are the ramifications.