10 examples of 'conda create requirements txt' in Python

Every line of 'conda create requirements txt' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
96def install_requirements():
97 # TODO: Detect when requirements.txt changes instead of checking for a file
98 if os.path.exists(requirements_installed_path):
99 return
100
101 print 'Installing requirements...'
102
103 shell(pip_path, 'install', '-r', 'requirements.txt')
104 shell(pip_path, 'install', os.path.join(vendor_path, 'nose-1.1.2.tar.gz'))
105 shell(pip_path, 'install', '-e', '.')
106
107 open(requirements_installed_path, 'w').close()
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

39def install_requirements() -> [str]:
40 return read_requirements_file("requirements.txt")
53def install_requirements():
54 prep_apt_get()
55 install_system_requirements()
56 install_virtualenv()
57 install_nginx()
656def write_setup_requirements(cmd, basename, filename):
657 data = io.StringIO()
658 _write_requirements(data, cmd.distribution.setup_requires)
659 cmd.write_or_delete_file("setup-requirements", filename, data.getvalue())
425def write_setup_requirements(cmd, basename, filename):
426 data = StringIO()
427 _write_requirements(data, cmd.distribution.setup_requires)
428 cmd.write_or_delete_file("setup-requirements", filename, data.getvalue())
32def _requirements():
33 with open('requirements.txt', 'r') as fd:
34 return [name.strip() for name in fd.readlines()]
8def get_requirements():
9 """Return the components defined in requirements.txt."""
10 with open('requirements.txt') as fin:
11 return [l.split()[0].split('#', 1)[0].strip() for l in fin
12 if l and not l.startswith('git')]
31def extract_requirements(filename):
32 with open(filename, 'r') as requirements_file:
33 return [x[:-1] for x in requirements_file.readlines()]
361def _requirements_maker(name, wheel_dir, release, build_dir, quiet, make_opts):
362 requirements_file_lines = []
363 for value in sorted(release.values()):
364 requirements_file_lines.append('%s\n' % value)
365
366 requirements_file = os.path.join(wheel_dir, name)
367 with open(requirements_file, 'wb') as f:
368 f.writelines(requirements_file_lines)
369
370 build_wheel(
371 wheel_dir=wheel_dir,
372 build_dir=build_dir,
373 dist=requirements_file,
374 quiet=quiet,
375 make_opts=make_opts
376 )
17def get_requirements():
18 """Loads contents from requirements.txt."""
19 requirements = []
20 with open('requirements.txt') as f:
21 data = f.read().splitlines()
22 if any(data):
23 data = data[1:]
24 requirements = [item.split(";")[0].split(" ")[0] for item in data]
25 return requirements

Related snippets