我正在尝试在Maven + pom.xml的帮助下安装setup.py中提到的所有库。但是在构建时,出现错误消息“无法在此目录中运行pip”。有人可以帮帮我,我将感谢您!!!
setup.py看起来如下
from setuptools.command.install import install as _install
from setuptools import setup,find_packages
import pip
import os
requirements = [l.strip() for l in open('requirements.txt').readlines()]
try:
long_description = open('README.md').read()
except IOError:
long_description = ''
setup(
name='robotframework',version='3.1.2',description='',url='https://qarepository.com/repository/pypi_all/simple',install_requires=[
"robotframework-selenium2library==3.0.0","robotframework-faker==4.2.0","robotframework-databaselibrary=1.2.4","robotframework-sshlibrary==3.3.0","pandas==0.25.0"
],include_package_data=True,zip_safe=False,platforms=['any'],)
Maven pom.xml看起来如下
plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>pip install (initialize)</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
<execution>
<configuration>
<executable>pip</executable>
<arguments>
<argument>install</argument>
<argument>${robotframework.version}</argument>
<argument>--proto_path=${basedir}/src/main/resources</argument>
<argument>--python_out=${project.build.directory}/demo</argument>
</arguments>
</configuration>
<id>generate-package</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>python</executable>
<workingDirectory>${project.build.directory}/demo</workingDirectory>
<arguments>
<argument>setup.py</argument>
<argument>sdist</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>